Browse Source

Merge branch 'foundations' of Shuvit-Org/shuvit into dev

weee
shuvit 3 years ago
parent
commit
70f916c036
81 changed files with 3308 additions and 1661 deletions
  1. 1
    0
      .~lock.shuvit_assets.ods#
  2. 3
    0
      assets/foiliage_b.blend
  3. 2
    2
      assets/kits/ramps.blend
  4. 2
    2
      assets/kits/ramps2.blend
  5. 3
    0
      assets/maps/Demo/map.blend
  6. 7
    0
      assets/maps/Demo/map_settings.ini
  7. 3
    0
      assets/maps/Frank's Garage/map.blend
  8. 7
    0
      assets/maps/Frank's Garage/map_settings.ini
  9. 3
    0
      assets/maps/Harry's Garage/map.blend
  10. 7
    0
      assets/maps/Harry's Garage/map_settings.ini
  11. 3
    0
      assets/maps/John's Mini/map.blend
  12. 7
    0
      assets/maps/John's Mini/map_settings.ini
  13. 3
    0
      assets/maps/Scratch/map.blend
  14. 7
    0
      assets/maps/Scratch/map_settings.ini
  15. 2
    2
      assets/materials/base_m_kit.blend
  16. 3
    0
      assets/materials/textures/Ceiling_A.png
  17. 3
    0
      assets/materials/textures/Ceiling_N.png
  18. 3
    0
      assets/materials/textures/Grunge_Masks_A.png
  19. 3
    0
      assets/materials/textures/bricks.png
  20. 3
    0
      assets/materials/textures/bricks_h.png
  21. 3
    0
      assets/materials/textures/bricks_hnb.png
  22. 3
    0
      assets/materials/textures/color_grid.png
  23. 3
    0
      assets/materials/textures/greyscale-pxb.png
  24. 3
    0
      assets/materials/textures/mountainslab01.png
  25. 3
    0
      assets/materials/textures/mountainslab01_n.png
  26. 3
    0
      assets/materials/textures/pineforest03.png
  27. 3
    0
      assets/materials/textures/pineforest03_n.png
  28. 3
    0
      assets/materials/textures/plywood_m_a.jpg
  29. 3
    0
      assets/materials/textures/plywood_m_d.jpg
  30. 3
    0
      assets/materials/textures/plywood_m_h.jpg
  31. 3
    0
      assets/materials/textures/plywood_m_hb.jpg
  32. 3
    0
      assets/materials/textures/plywood_m_hn.jpg
  33. 3
    0
      assets/materials/textures/plywood_m_ln.jpg
  34. 3
    0
      assets/materials/textures/plywood_m_mn.jpg
  35. 3
    0
      assets/materials/textures/plywood_m_n.jpg
  36. 3
    0
      assets/materials/textures/plywood_m_s.jpg
  37. 3
    0
      assets/materials/textures/plywood_m_sn.jpg
  38. 3
    0
      assets/materials/textures/ramp_trans_n.png
  39. 3
    0
      assets/materials/textures/ramp_trans_nb.png
  40. 3
    0
      assets/new_ass_test.blend
  41. 3
    0
      assets/ramps.blend
  42. 2
    2
      assets/user2.blend
  43. 2
    2
      assets/utils/mini_ramp_gen15new_text.blend
  44. 3
    0
      assets/walls.blend
  45. 2
    2
      characters/ken.blend
  46. 24
    16
      config.ini
  47. 46
    2
      scripts/FSM.py
  48. 11
    11
      scripts/Record.py
  49. 66
    18
      scripts/Settings.py
  50. 7
    1
      scripts/Startup.py
  51. 124
    7
      scripts/StatesGame.py
  52. 805
    0
      scripts/StatesPlayer.py
  53. 191
    187
      scripts/actionPlayer.py
  54. 24
    19
      scripts/actionsFSMlist.py
  55. 15
    3
      scripts/boneRecord.py
  56. 3
    4
      scripts/camera.py
  57. 30
    11
      scripts/controller2.py
  58. 37
    0
      scripts/game.py
  59. 43
    40
      scripts/grindV2.py
  60. 1
    1
      scripts/inputs.py
  61. 12
    0
      scripts/levelLibload.py
  62. 2
    19
      scripts/logo_fades.py
  63. 37
    16
      scripts/menuV3.py
  64. 2
    1
      scripts/npause.py
  65. 29
    27
      scripts/pause_menu2.py
  66. 565
    0
      scripts/player.py
  67. 58
    34
      scripts/ragdoll.py
  68. 11
    4
      scripts/scene_init.py
  69. 28
    6
      scripts/sound_man.py
  70. 961
    1220
      scripts/walk.py
  71. 2
    2
      shuvit.blend
  72. BIN
      shuvit_assets.ods
  73. 3
    0
      sounds/s_l_1.wav
  74. 3
    0
      sounds/s_l_2.wav
  75. 3
    0
      sounds/s_r_1.wav
  76. 3
    0
      sounds/s_r_2.wav
  77. 3
    0
      sounds/walk_climb.wav
  78. 3
    0
      sounds/walk_grunt.wav
  79. 3
    0
      sounds/walk_hang.wav
  80. 3
    0
      sounds/walk_land.wav
  81. 3
    0
      sounds/walkondirt.wav

+ 1
- 0
.~lock.shuvit_assets.ods# View File

1
+,rob,rob-XPS,12.05.2020 10:27,file:///home/rob/.config/libreoffice/4;

+ 3
- 0
assets/foiliage_b.blend View File

1
+version https://git-lfs.github.com/spec/v1
2
+oid sha256:41e28fb10464bc68bcac66ddee5e21ffc460fa9207706b108802910e130b96bb
3
+size 43079304

+ 2
- 2
assets/kits/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:2d4bed47956024b6fdda2f3f743b37b059ce591e0fbc12d3e86cc26c27f8ba9c
3
-size 149841436
2
+oid sha256:29696d65de25e271a669c8ce0dbe78f9ffb5b606969c5d8c9294b3d649c3113b
3
+size 24216420

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

1
 version https://git-lfs.github.com/spec/v1
1
 version https://git-lfs.github.com/spec/v1
2
-oid sha256:498ef10ab3bc64f9507ee4dc827291a714a86b7c843418df64f2f7972f9bb337
3
-size 24141316
2
+oid sha256:c6146e4b9d01ad879ad962f9666408f27efac8a3f045411774d2d2f4b30d3627
3
+size 24031756

+ 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

+ 3
- 0
assets/maps/John's Mini/map.blend View File

1
+version https://git-lfs.github.com/spec/v1
2
+oid sha256:97270cdd70f1424750c52c51b3f0de032422160ad3a6ee7532830b4f2813dbb6
3
+size 1211092

+ 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

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

1
+version https://git-lfs.github.com/spec/v1
2
+oid sha256:80da2750251e443d10fe87c4831cbd303754d9a8f43b0cd447faca8b2a184956
3
+size 21404212

+ 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:6c37e5a83e1644e6488940c883139290940717fc94f675b34431f2136b41e62f
3
-size 35553820
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/mountainslab01.png View File

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

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

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

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

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

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

1
+version https://git-lfs.github.com/spec/v1
2
+oid sha256:72e39a36c94b29279c26f86765645a3ed599f7b5b450ed470abed4d611394a2f
3
+size 2281480

+ 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

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

1
+version https://git-lfs.github.com/spec/v1
2
+oid sha256:98a113465808a42062053be89ad179f1df3ba4fd01c89b7a7aaebbcace35609c
3
+size 11320

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

1
+version https://git-lfs.github.com/spec/v1
2
+oid sha256:9b06b6f04c271ea6523932def0c1b0813cb7d1df90b0e2f7ee22cfcd61200502
3
+size 30364

+ 3
- 0
assets/new_ass_test.blend View File

1
+version https://git-lfs.github.com/spec/v1
2
+oid sha256:529854bcecbe01c029bf1ba49e97acd152dbc2c2ad7e8b2b32b97d91d025c432
3
+size 848896

+ 3
- 0
assets/ramps.blend View File

1
+version https://git-lfs.github.com/spec/v1
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:967c340fc4b16c93e9c64993595238e08da030575f98ddd663c2f8d6e5810059
3
-size 19833196
2
+oid sha256:290945cb39568c3ecffdfe59a94d188c0e20dd7eac5b7c33c4b4393a396d6fac
3
+size 3403128

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

1
 version https://git-lfs.github.com/spec/v1
1
 version https://git-lfs.github.com/spec/v1
2
-oid sha256:028b82f4ecdbd46bdc2961cb4bcaa074664c2aeba68e18c6ea51795c1dc9759b
3
-size 119822052
2
+oid sha256:09b66fd8ac81815a16f9daaf3742ab0397919b0bbf6b9e35988bd1b564d71388
3
+size 140836564

+ 3
- 0
assets/walls.blend View File

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

+ 2
- 2
characters/ken.blend View File

1
 version https://git-lfs.github.com/spec/v1
1
 version https://git-lfs.github.com/spec/v1
2
-oid sha256:e5831d9cf377773a4db5172fb6a16fde1cfc1394fffc1be0adefd45b916fc1fa
3
-size 2869804
2
+oid sha256:6ba3abc8379099161710e43cf63b20f31c2a32532d14cc74a36b91429015198a
3
+size 2870372

+ 24
- 16
config.ini View File

15
 resx = 1920
15
 resx = 1920
16
 resy = 1080
16
 resy = 1080
17
 fullscreen_on = 1
17
 fullscreen_on = 1
18
-music_player = 0
18
+music_player = 1
19
 vsync_on = 0
19
 vsync_on = 0
20
 #----------
20
 #----------
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
33
 
34
 
34
 #camera 
35
 #camera 
35
 #######
36
 #######
36
-cam_height = -0.1
37
-focal_length = 12
38
-cam_min = 1.4
37
+cam_height = -0.3
38
+focal_length = 10
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
41
 
42
 
54
 
55
 
55
 shirt_logo = 2
56
 shirt_logo = 2
56
 
57
 
57
-shirt_color_r = 0.4
58
+shirt_color_r = 1
58
 shirt_color_g = 0.03
59
 shirt_color_g = 0.03
59
 shirt_color_b = 0.03
60
 shirt_color_b = 0.03
60
 
61
 
61
-shoe_color_r = 0.31
62
-shoe_color_g = 0.23
62
+shoe_color_r = 1
63
+shoe_color_g = 0.38
63
 shoe_color_b = 0
64
 shoe_color_b = 0
64
 #-----------------
65
 #-----------------
65
 
66
 
91
 ###################
92
 ###################
92
 
93
 
93
 #brightness / contrast
94
 #brightness / contrast
94
-bc = 1
95
+bc = 0
95
 BC_BRIGHTNESS = 1.1
96
 BC_BRIGHTNESS = 1.1
96
 BC_CONTRAST = 1.09
97
 BC_CONTRAST = 1.09
97
 
98
 
98
 #HDR
99
 #HDR
99
 hdr = 1
100
 hdr = 1
100
-avgL = 0.8
101
+avgL = 0.69
101
 HDRamount = 0.05
102
 HDRamount = 0.05
102
 
103
 
103
 #Ambient Occlusion
104
 #Ambient Occlusion
107
 aoradius = 2.4
108
 aoradius = 2.4
108
 
109
 
109
 #Depth of Field
110
 #Depth of Field
110
-dof_on = 1
111
+dof_on = 0
111
 
112
 
112
 #Bloom
113
 #Bloom
113
 bloom_on = 0
114
 bloom_on = 0
114
 
115
 
115
 #FXAA
116
 #FXAA
116
-fxaa = 1
117
+fxaa = 0
117
 FXAA_SPAN_MAX = 8.0
118
 FXAA_SPAN_MAX = 8.0
118
 #-------------------
119
 #-------------------
119
 
120
 
120
 #sun settings
121
 #sun settings
121
 #############
122
 #############
122
-sun_strength = 0.95
123
-ambient_strength = 0.15
123
+sun_strength = 1.1
124
+ambient_strength = 0.18
124
 sun_rot_x = -0.05
125
 sun_rot_x = -0.05
125
 sun_rot_y = -0.05
126
 sun_rot_y = -0.05
126
 shadow_on = 0
127
 shadow_on = 0
143
 man_sens_l = 0.03
144
 man_sens_l = 0.03
144
 man_sens_r = 0.08
145
 man_sens_r = 0.08
145
 man_sens_side = 0.035
146
 man_sens_side = 0.035
146
-turn_rotation = 0.0175
147
+turn_rotation = 0.025#0.0175
147
 turn_addx = 0.004
148
 turn_addx = 0.004
148
 turn_air_rotation = 0.07
149
 turn_air_rotation = 0.07
149
 grass_mult = 0.98
150
 grass_mult = 0.98
152
 gravity = -10.5
153
 gravity = -10.5
153
 fall_height = 0.5
154
 fall_height = 0.5
154
 
155
 
156
+walk_force = 15
157
+run_force = 40
158
+max_walk_vel = 1.5
159
+max_run_vel = 5
160
+walk_turn_amt = 0.03
161
+walk_jump_force = 1300
162
+
155
 #controller mappings
163
 #controller mappings
156
 ########
164
 ########
157
 lar_lts = 0
165
 lar_lts = 0

+ 46
- 2
scripts/FSM.py View File

1
 import bge
1
 import bge
2
 
2
 
3
+import StatesGame
4
+import StatesPlayer
3
 import StatesWalker
5
 import StatesWalker
4
 import StatesCamera
6
 import StatesCamera
5
 import StatesCar
7
 import StatesCar
26
         self.stateLife = 0
28
         self.stateLife = 0
27
         self.owner = owner
29
         self.owner = owner
28
         self.name = None
30
         self.name = None
31
+        self.last_state_notes = None
29
         
32
         
30
     def AddTransition(self, transName, transition):
33
     def AddTransition(self, transName, transition):
31
         self.transitions[transName] = transition
34
         self.transitions[transName] = transition
67
         self.owner = owner
70
         self.owner = owner
68
         
71
         
69
         state_list = [
72
         state_list = [
70
-        'Example']
73
+        'Example',
74
+        'Startup',
75
+        'Initer',
76
+        'LoadLevel',
77
+        'GameOn',
78
+        'Reload']
71
         
79
         
72
         for s in state_list:
80
         for s in state_list:
73
             self.FSM.AddState(s, getattr(StatesGame, s)(self.FSM))
81
             self.FSM.AddState(s, getattr(StatesGame, s)(self.FSM))
75
             self.FSM.AddTransition(t, Transition(s))
83
             self.FSM.AddTransition(t, Transition(s))
76
         
84
         
77
         if self.FSM.curState == None:
85
         if self.FSM.curState == None:
78
-            self.FSM.SetState('Example')
86
+            self.FSM.SetState('Startup')
87
+    
88
+    def Execute(self):
89
+        self.FSM.Execute(self.owner)    
90
+
91
+#=================================== 
92
+        
93
+class PlayerFSM(Char):
94
+    def __init__(self, owner):
95
+        self.FSM = FSM(self, owner)
96
+        self.owner = owner
97
+        
98
+        state_list = [
99
+        'Example',
100
+        'Startup',
101
+        'Walk',
102
+        'WalkJump',
103
+        'WalkAir',
104
+        'WalkLand',
105
+        'WalkHang',
106
+        'WalkClimb',
107
+        'WalkHurdle',
108
+        'WalkOnboard',
109
+        'AirOnboard',
110
+        'Offboard', 
111
+        'Dropin',
112
+        'Roll',
113
+        'Ragdoll',
114
+        'Pause']
115
+        
116
+        for s in state_list:
117
+            self.FSM.AddState(s, getattr(StatesPlayer, s)(self.FSM))
118
+            t = 'to' + s
119
+            self.FSM.AddTransition(t, Transition(s))
120
+        
121
+        if self.FSM.curState == None:
122
+            self.FSM.SetState('Startup')
79
     
123
     
80
     def Execute(self):
124
     def Execute(self):
81
         self.FSM.Execute(self.owner)    
125
         self.FSM.Execute(self.owner)    

+ 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"]

+ 66
- 18
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"
34
     
75
     
35
     
76
     
36
     def to_dict2(section, key):
77
     def to_dict2(section, key):
37
-        dict = bge.logic.globalDict
78
+        #dict = bge.logic.globalDict
38
         value = char_config[key]
79
         value = char_config[key]
39
         if isinstance(value, str):
80
         if isinstance(value, str):
40
             if value.isdigit():
81
             if value.isdigit():
51
     char_config.walk(to_dict2, char_config)
92
     char_config.walk(to_dict2, char_config)
52
     
93
     
53
 def writeChar():
94
 def writeChar():
54
-    dict = bge.logic.globalDict
95
+    #dict = bge.logic.globalDict
55
     mainDir = GameLogic.expandPath("//characters/")    
96
     mainDir = GameLogic.expandPath("//characters/")    
56
     fileName = mainDir + dict['character'] + ".ini"
97
     fileName = mainDir + dict['character'] + ".ini"
57
     print('writing character settings', fileName)
98
     print('writing character settings', fileName)
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):
73
-    dict = bge.logic.globalDict
119
+    #dict = bge.logic.globalDict
74
     config[key] = dict[key]
120
     config[key] = dict[key]
75
 
121
 
76
 def writeSettings():
122
 def writeSettings():
77
     config.walk(from_dict)  
123
     config.walk(from_dict)  
78
     config.write()  
124
     config.write()  
79
-    dict = bge.logic.globalDict
125
+    #dict = bge.logic.globalDict
80
      
126
      
81
 def setres():
127
 def setres():
82
-    import GameLogic
83
-    import bge
128
+    #import GameLogic
129
+    #import bge
84
     scenes = bge.logic.getSceneList()
130
     scenes = bge.logic.getSceneList()
85
     main_scene = [scene for scene in scenes if scene.name=="main"][0]
131
     main_scene = [scene for scene in scenes if scene.name=="main"][0]
86
     own = main_scene.objects['Empty']
132
     own = main_scene.objects['Empty']
87
-    cont = GameLogic.getCurrentController()
133
+    cont = bge.logic.getCurrentController()
88
     own2 = cont.owner
134
     own2 = cont.owner
89
     dict = bge.logic.globalDict 
135
     dict = bge.logic.globalDict 
90
     resx = int(dict["resx"])
136
     resx = int(dict["resx"])
104
     #print("resolution = ", resx, resy)       
150
     #print("resolution = ", resx, resy)       
105
         
151
         
106
 def loadlevel():
152
 def loadlevel():
107
-    import GameLogic
108
-    import bge
109
     scenes = bge.logic.getSceneList()
153
     scenes = bge.logic.getSceneList()
110
     main_scene = [scene for scene in scenes if scene.name=="main"][0]
154
     main_scene = [scene for scene in scenes if scene.name=="main"][0]
111
     own = main_scene.objects['Empty']
155
     own = main_scene.objects['Empty']
119
     if own["profile"] ==1:    
163
     if own["profile"] ==1:    
120
         bge.render.showProfile(1)   
164
         bge.render.showProfile(1)   
121
     act = own2.actuators["level"]
165
     act = own2.actuators["level"]
122
-    dict = bge.logic.globalDict
123
-    level = dict['level']
124
-    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)
125
     act.scene = level 
176
     act.scene = level 
126
     cont.activate(own2.actuators["level"]) 
177
     cont.activate(own2.actuators["level"]) 
127
     dict['npause'] = False 
178
     dict['npause'] = False 
128
     
179
     
129
 def timer():
180
 def timer():
130
-    import GameLogic
131
-    import bge    
132
-
133
-    dict = bge.logic.globalDict    
181
+    #dict = bge.logic.globalDict    
134
     
182
     
135
     if dict['reload_timer'] == 1:
183
     if dict['reload_timer'] == 1:
136
         scene = bge.logic.getCurrentScene()
184
         scene = bge.logic.getCurrentScene()

+ 7
- 1
scripts/Startup.py View File

2
 
2
 
3
 def main(cont):
3
 def main(cont):
4
     #cont = bge.logic.getCurrentController() 
4
     #cont = bge.logic.getCurrentController() 
5
+    print('Startup.py running ----------')
5
     own = cont.owner
6
     own = cont.owner
6
     scenes = bge.logic.getSceneList()
7
     scenes = bge.logic.getSceneList()
7
 
8
 
102
     dict['sunz'] = 1.0 
103
     dict['sunz'] = 1.0 
103
     dict['replay_loop_start'] = 0
104
     dict['replay_loop_start'] = 0
104
     dict['replay_loop_end'] = 0
105
     dict['replay_loop_end'] = 0
105
-    dict['replay_record_length'] = 7300#240 #1200 #7300
106
+    dict['replay_record_length'] = 2600#240 #1200 #7300
106
     dict['rp_keyframes'] = []
107
     dict['rp_keyframes'] = []
107
     dict['rp_positions'] = []
108
     dict['rp_positions'] = []
108
     dict['temp_list'] = []
109
     dict['temp_list'] = []
109
     dict['scene_inited'] = True
110
     dict['scene_inited'] = True
110
     dict['p1c'] = None
111
     dict['p1c'] = None
112
+    dict['sun_lights'] = []
113
+    dict['ambient_lights'] = []
114
+
115
+    dict['joy_con'] = False
116
+    
111
     
117
     
112
 #main()
118
 #main()

+ 124
- 7
scripts/StatesGame.py View File

1
-import utils
2
 import bge
1
 import bge
2
+import random
3
+
4
+import Startup as S2
5
+import Settings
6
+import inputs
7
+import logo_fades
8
+
9
+dict = bge.logic.globalDict
10
+#====================================     
3
 
11
 
4
 State = type("State", (object,), {})
12
 State = type("State", (object,), {})
5
 #====================================     
13
 #====================================     
15
         print('Executing')
23
         print('Executing')
16
     def Exit(self):
24
     def Exit(self):
17
         print('Exiting')
25
         print('Exiting')
26
+
18
 #==================================== 
27
 #==================================== 
19
             
28
             
20
 class Example(State):
29
 class Example(State):
27
         
36
         
28
     def Execute(self):
37
     def Execute(self):
29
         self.FSM.stateLife += 1
38
         self.FSM.stateLife += 1
30
-        #o = self.FSM.owner
31
-        #g = o.me['game']
32
-        #self.FSM.ToTransition('toNewState')
33
-        #print('cam fsm')
34
-    
39
+        #self.FSM.ToTransition('toLand')
40
+        
41
+    def Exit(self):
42
+        pass
43
+
44
+#==================================== 
45
+
46
+class Startup(State):
47
+    def __init__(self,FSM):
48
+        super(Startup, self).__init__(FSM)    
49
+        
50
+    def Enter(self):
51
+        self.FSM.stateLife = 1
52
+        super(Startup, self).Enter()        
53
+        
54
+    def Execute(self):
55
+        self.FSM.stateLife += 1
56
+
57
+        #if self.FSM.stateLife == 2:
58
+            #Startup.main(self.FSM.owner['cont'])
59
+
60
+        self.FSM.ToTransition('toIniter')
61
+        
62
+    def Exit(self):
63
+        pass
64
+
65
+#==================================== 
66
+
67
+class Initer(State):
68
+    def __init__(self,FSM):
69
+        super(Initer, self).__init__(FSM)    
70
+        
71
+    def Enter(self):
72
+        self.FSM.stateLife = 1
73
+        super(Initer, self).Enter()        
74
+        
75
+    def Execute(self):
76
+        self.FSM.stateLife += 1
77
+
78
+        if self.FSM.stateLife == 2:
79
+            print('--------- fsm running startup')
80
+            S2.main(self.FSM.owner['cont'])
81
+            #Settings.readSettings(self.FSM.owner['cont'])
82
+            Settings.readSettings()
83
+            Settings.setres()
84
+
85
+
86
+        if self.FSM.stateLife == 120:
87
+
88
+            self.FSM.ToTransition('toLoadLevel')
89
+        
90
+    def Exit(self):
91
+        pass
92
+
93
+
94
+#==================================== 
95
+
96
+class LoadLevel(State):
97
+    def __init__(self,FSM):
98
+        super(LoadLevel, self).__init__(FSM)    
99
+        
100
+    def Enter(self):
101
+        self.FSM.stateLife = 1
102
+        super(LoadLevel, self).Enter()        
103
+        
104
+    def Execute(self):
105
+        self.FSM.stateLife += 1
106
+        print('fsm loading level')
107
+        
108
+        Settings.loadlevel()
109
+        
110
+        self.FSM.ToTransition('toGameOn')
111
+    def Exit(self):
112
+        pass
113
+
114
+#==================================== 
115
+
116
+class GameOn(State):
117
+    def __init__(self,FSM):
118
+        super(GameOn, self).__init__(FSM)    
119
+        
120
+    def Enter(self):
121
+        self.FSM.stateLife = 1
122
+        super(GameOn, self).Enter()        
123
+        
124
+    def Execute(self):
125
+        self.FSM.stateLife += 1
126
+        #self.FSM.ToTransition('toLand')
127
+        #print('game on')
128
+
129
+        inputs.main()
130
+        logo_fades.main()
131
+
132
+    def Exit(self):
133
+        pass
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
+
35
     def Exit(self):
152
     def Exit(self):
36
         pass
153
         pass
37
 
154
 
38
-#====================================  
155
+#==================================== 

+ 805
- 0
scripts/StatesPlayer.py View File

1
+import bge
2
+dict = bge.logic.globalDict
3
+import sound_man
4
+#====================================     
5
+
6
+State = type("State", (object,), {})
7
+#====================================     
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')
20
+
21
+#==================================== 
22
+			
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
37
+
38
+#==================================== 
39
+
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
57
+
58
+#==================================== 
59
+			
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
+		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
302
+
303
+
304
+#==================================== 
305
+			
306
+class WalkAir(State):
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)
369
+
370
+#==================================== 
371
+			
372
+class WalkJump(State):
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
415
+
416
+#==================================== 
417
+			
418
+class WalkLand(State):
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
453
+
454
+#==================================== 
455
+			
456
+class WalkHang(State):
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
517
+
518
+#==================================== 
519
+			
520
+class WalkClimb(State):
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                                
543
+
544
+#==================================== 
545
+			
546
+class WalkHurdle(State):
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                                
560
+
561
+
562
+#==================================== 
563
+
564
+			
565
+class WalkOnboard(State):
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
591
+
592
+#==================================== 
593
+
594
+
595
+			
596
+class AirOnboard(State):
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
626
+
627
+#==================================== 
628
+			
629
+class Roll(State):
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
655
+
656
+#==================================== 
657
+
658
+class Offboard(State):
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
684
+#==================================== 
685
+
686
+class Ragdoll(State):
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                                
711
+
712
+#==================================== 
713
+			
714
+class Dropin(State):
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
777
+
778
+
779
+
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
+#==================================== 

+ 191
- 187
scripts/actionPlayer.py View File

175
 'fak_jump',
175
 'fak_jump',
176
 'fak_walk_air',
176
 'fak_walk_air',
177
 'fak_walk_air_out',
177
 'fak_walk_air_out',
178
-#'fak_onboard',
178
+'fak_onboard',
179
 #'fak_offboard',
179
 #'fak_offboard',
180
 'fak_brfoot',
180
 'fak_brfoot',
181
 'fak_frfoot',
181
 'fak_frfoot',
278
 	return aState	
278
 	return aState	
279
 
279
 
280
 def main(cont):
280
 def main(cont):
281
-	own = cont.owner
282
 	dict = bge.logic.globalDict
281
 	dict = bge.logic.globalDict
282
+	if not dict['walking']:
283
+		own = cont.owner
284
+		
283
 
285
 
284
-	#initial state
285
-	if 'aState' not in own:
286
-		own['aState'] = 'reg_idle'
287
-		own['l_aState'] = None
288
-		own['stateTimer'] = 0
289
-		own['eaState'] = FSM.EaFSM(own)
290
-		own['EaRequest'] = None
291
-	
292
-	aState = own['aState']
293
-	rA = own['requestAction']
294
-	timer = own['stateTimer']
295
-	newState = own['aState']
296
-	aState = check_land(rA, aState, own)
297
-	newState = aState
298
-	og_state = own['aState']
299
-	#print(aState)
300
-	if aState in state_a:
301
-
302
-		action = getattr(actionsFSMlist, aState)
303
-		if own['stateTimer'] < getattr(action, 'intro_frames'):	
304
-			intro = getattr(action, 'intro')
305
-			actionPlayer(getattr(actionsFSMlist, intro))	
306
-		else:
307
-			actionPlayer(action)
308
-		newState = check_exit(aState, rA, timer, action)
309
-			
310
 
286
 
311
-	elif aState in state_b:
312
-		action = getattr(actionsFSMlist, aState)
313
-		actionPlayer(action)
314
-		if own['stateTimer'] > getattr(action, 'fef'):
287
+		#initial state
288
+		if 'aState' not in own:
289
+			own['aState'] = 'reg_idle'
290
+			own['l_aState'] = None
291
+			own['stateTimer'] = 0
292
+			own['eaState'] = FSM.EaFSM(own)
293
+			own['EaRequest'] = None
294
+		
295
+		aState = own['aState']
296
+		rA = own['requestAction']
297
+		timer = own['stateTimer']
298
+		newState = own['aState']
299
+		aState = check_land(rA, aState, own)
300
+		newState = aState
301
+		og_state = own['aState']
302
+		#print(aState)
303
+		if aState in state_a:
304
+
305
+			action = getattr(actionsFSMlist, aState)
306
+			if own['stateTimer'] < getattr(action, 'intro_frames'):	
307
+				intro = getattr(action, 'intro')
308
+				actionPlayer(getattr(actionsFSMlist, intro))	
309
+			else:
310
+				actionPlayer(action)
315
 			newState = check_exit(aState, rA, timer, action)
311
 			newState = check_exit(aState, rA, timer, action)
312
+				
316
 
313
 
317
-
318
-###################################
319
-
320
-	check_state = 'reg_sit'
321
-	if aState == check_state:
322
-		action = getattr(actionsFSMlist, check_state)
323
-		#if own['stateTimer'] < 19:
324
-		if own['stateTimer'] < getattr(action, 'intro_frames'):	
325
-			actionPlayer(getattr(actionsFSMlist, 'intro'))
326
-		else:
314
+		elif aState in state_b:
315
+			action = getattr(actionsFSMlist, aState)
327
 			actionPlayer(action)
316
 			actionPlayer(action)
328
-		newState = check_exit(aState, rA, timer, actionsFSMlist.reg_sit)
329
-
330
-	#-----------------------
331
-	check_state = 'reg_walk'
332
-	if aState == check_state:
333
-		action = getattr(actionsFSMlist, check_state)
334
-		if own['l_aState'] == 'reg_walkFast':
335
-			frame = get_frame(actionsFSMlist.reg_walkFast)
336
-			actionPlayer(action)
337
-			set_frame(actionsFSMlist.reg_walk, frame)
338
-		else:	
339
-			frame = actionPlayer(action)
340
-		
341
-		newState = check_exit(aState, rA, timer, action)
317
+			if own['stateTimer'] > getattr(action, 'fef'):
318
+				newState = check_exit(aState, rA, timer, action)
319
+
320
+
321
+	###################################
322
+
323
+		check_state = 'reg_sit'
324
+		if aState == check_state:
325
+			action = getattr(actionsFSMlist, check_state)
326
+			#if own['stateTimer'] < 19:
327
+			if own['stateTimer'] < getattr(action, 'intro_frames'):	
328
+				actionPlayer(getattr(actionsFSMlist, 'intro'))
329
+			else:
330
+				actionPlayer(action)
331
+			newState = check_exit(aState, rA, timer, actionsFSMlist.reg_sit)
332
+
333
+		#-----------------------
334
+		check_state = 'reg_walk'
335
+		if aState == check_state:
336
+			action = getattr(actionsFSMlist, check_state)
337
+			if own['l_aState'] == 'reg_walkFast':
338
+				frame = get_frame(actionsFSMlist.reg_walkFast)
339
+				actionPlayer(action)
340
+				set_frame(actionsFSMlist.reg_walk, frame)
341
+			else:	
342
+				frame = actionPlayer(action)
343
+			
344
+			newState = check_exit(aState, rA, timer, action)
342
 
345
 
343
-	#-----------------------
344
-	check_state = 'reg_walkFast'
345
-	if aState == check_state:
346
-		action = getattr(actionsFSMlist, check_state)
347
-		newState = check_exit(aState, rA, timer, actionsFSMlist.reg_walkFast)
346
+		#-----------------------
347
+		check_state = 'reg_walkFast'
348
+		if aState == check_state:
349
+			action = getattr(actionsFSMlist, check_state)
350
+			newState = check_exit(aState, rA, timer, actionsFSMlist.reg_walkFast)
348
 
351
 
349
-		if own['l_aState'] == 'reg_walk':
350
-			frame = get_frame(actionsFSMlist.reg_walk)
351
-			actionPlayer(action)
352
-			set_frame(actionsFSMlist.reg_walkFast, frame)
352
+			if own['l_aState'] == 'reg_walk':
353
+				frame = get_frame(actionsFSMlist.reg_walk)
354
+				actionPlayer(action)
355
+				set_frame(actionsFSMlist.reg_walkFast, frame)
353
 
356
 
354
-		else:
355
-			actionPlayer(action)
357
+			else:
358
+				actionPlayer(action)
356
 
359
 
357
-	check_state = 'reg_push'
358
-	if aState == check_state:
359
-		action = getattr(actionsFSMlist, check_state)
360
-		actionPlayer(action)
361
-		if own['stateTimer'] > 70:
362
-			newState = 'reg_roll'
363
-
364
-	check_state = 'reg_push_goof'
365
-	if aState == check_state:
366
-		action = getattr(actionsFSMlist, check_state)
367
-		actionPlayer(action)
368
-		if own['stateTimer'] > 70:
369
-			newState = 'reg_roll'			
370
-	
371
-	check_state = 'reg_powerslide'
372
-	if aState == check_state:
373
-		action = getattr(actionsFSMlist, check_state)
374
-		# if own['stateTimer'] < 20:
375
-		# 	actionPlayer(actionsFSMlist.reg_powerslide_in)
376
-		if own['stateTimer'] < getattr(action, 'intro_frames'):	
377
-			intro = getattr(action, 'intro')
378
-			actionPlayer(getattr(actionsFSMlist, intro))	
379
-		else:
380
-			actionPlayer(action)
381
-		newState = check_exit(aState, rA, timer, actionsFSMlist.reg_powerslide)
382
-
383
-	check_state = 'reg_fs_powerslide'
384
-	if aState == check_state:
385
-		action = getattr(actionsFSMlist, check_state)
386
-		# if own['stateTimer'] < 20:
387
-		# 	actionPlayer(actionsFSMlist.reg_fs_powerslide_in)
388
-		if own['stateTimer'] < getattr(action, 'intro_frames'):	
389
-			intro = getattr(action, 'intro')
390
-			actionPlayer(getattr(actionsFSMlist, intro))	
391
-		else:
360
+		check_state = 'reg_push'
361
+		if aState == check_state:
362
+			action = getattr(actionsFSMlist, check_state)
392
 			actionPlayer(action)
363
 			actionPlayer(action)
393
-		newState = check_exit(aState, rA, timer, actionsFSMlist.reg_fs_powerslide)				
394
-
395
-
364
+			if own['stateTimer'] > 70:
365
+				newState = 'reg_roll'
396
 
366
 
397
-	check_state = 'fak_sit'
398
-	if aState == check_state:
399
-		action = getattr(actionsFSMlist, check_state)
400
-		#if own['stateTimer'] < 19:
401
-		if own['stateTimer'] < getattr(action, 'intro_frames'):	
402
-			actionPlayer(getattr(actionsFSMlist, 'intro'))
403
-		else:
404
-			actionPlayer(action)
405
-		newState = check_exit(aState, rA, timer, actionsFSMlist.fak_sit)
406
-
407
-	#-----------------------
408
-	check_state = 'fak_walk'
409
-	if aState == check_state:
410
-		action = getattr(actionsFSMlist, check_state)
411
-		if own['l_aState'] == 'fak_walkFast':
412
-			frame = get_frame(actionsFSMlist.fak_walkFast)
367
+		check_state = 'reg_push_goof'
368
+		if aState == check_state:
369
+			action = getattr(actionsFSMlist, check_state)
413
 			actionPlayer(action)
370
 			actionPlayer(action)
414
-			set_frame(actionsFSMlist.fak_walk, frame)
415
-		else:	
416
-			frame = actionPlayer(action)
371
+			if own['stateTimer'] > 70:
372
+				newState = 'reg_roll'			
417
 		
373
 		
418
-		newState = check_exit(aState, rA, timer, action)
374
+		check_state = 'reg_powerslide'
375
+		if aState == check_state:
376
+			action = getattr(actionsFSMlist, check_state)
377
+			# if own['stateTimer'] < 20:
378
+			# 	actionPlayer(actionsFSMlist.reg_powerslide_in)
379
+			if own['stateTimer'] < getattr(action, 'intro_frames'):	
380
+				intro = getattr(action, 'intro')
381
+				actionPlayer(getattr(actionsFSMlist, intro))	
382
+			else:
383
+				actionPlayer(action)
384
+			newState = check_exit(aState, rA, timer, actionsFSMlist.reg_powerslide)
385
+
386
+		check_state = 'reg_fs_powerslide'
387
+		if aState == check_state:
388
+			action = getattr(actionsFSMlist, check_state)
389
+			# if own['stateTimer'] < 20:
390
+			# 	actionPlayer(actionsFSMlist.reg_fs_powerslide_in)
391
+			if own['stateTimer'] < getattr(action, 'intro_frames'):	
392
+				intro = getattr(action, 'intro')
393
+				actionPlayer(getattr(actionsFSMlist, intro))	
394
+			else:
395
+				actionPlayer(action)
396
+			newState = check_exit(aState, rA, timer, actionsFSMlist.reg_fs_powerslide)				
397
+
398
+
399
+
400
+		check_state = 'fak_sit'
401
+		if aState == check_state:
402
+			action = getattr(actionsFSMlist, check_state)
403
+			#if own['stateTimer'] < 19:
404
+			if own['stateTimer'] < getattr(action, 'intro_frames'):	
405
+				actionPlayer(getattr(actionsFSMlist, 'intro'))
406
+			else:
407
+				actionPlayer(action)
408
+			newState = check_exit(aState, rA, timer, actionsFSMlist.fak_sit)
409
+
410
+		#-----------------------
411
+		check_state = 'fak_walk'
412
+		if aState == check_state:
413
+			action = getattr(actionsFSMlist, check_state)
414
+			if own['l_aState'] == 'fak_walkFast':
415
+				frame = get_frame(actionsFSMlist.fak_walkFast)
416
+				actionPlayer(action)
417
+				set_frame(actionsFSMlist.fak_walk, frame)
418
+			else:	
419
+				frame = actionPlayer(action)
420
+			
421
+			newState = check_exit(aState, rA, timer, action)
419
 
422
 
420
-	#-----------------------
421
-	check_state = 'fak_walkFast'
422
-	if aState == check_state:
423
-		action = getattr(actionsFSMlist, check_state)
424
-		newState = check_exit(aState, rA, timer, actionsFSMlist.fak_walkFast)
423
+		#-----------------------
424
+		check_state = 'fak_walkFast'
425
+		if aState == check_state:
426
+			action = getattr(actionsFSMlist, check_state)
427
+			newState = check_exit(aState, rA, timer, actionsFSMlist.fak_walkFast)
425
 
428
 
426
-		if own['l_aState'] == 'fak_walk':
427
-			frame = get_frame(actionsFSMlist.fak_walk)
428
-			actionPlayer(action)
429
-			set_frame(actionsFSMlist.fak_walkFast, frame)
429
+			if own['l_aState'] == 'fak_walk':
430
+				frame = get_frame(actionsFSMlist.fak_walk)
431
+				actionPlayer(action)
432
+				set_frame(actionsFSMlist.fak_walkFast, frame)
430
 
433
 
431
-		else:
432
-			actionPlayer(action)
434
+			else:
435
+				actionPlayer(action)
433
 
436
 
434
 
437
 
435
-	check_state = 'fak_push'
436
-	if aState == check_state:
437
-		action = getattr(actionsFSMlist, check_state)
438
-		actionPlayer(action)
439
-		if own['stateTimer'] > 70:
440
-			newState = 'fak_roll'
438
+		check_state = 'fak_push'
439
+		if aState == check_state:
440
+			action = getattr(actionsFSMlist, check_state)
441
+			actionPlayer(action)
442
+			if own['stateTimer'] > 70:
443
+				newState = 'fak_roll'
441
 
444
 
442
-	check_state = 'fak_push_goof'
443
-	if aState == check_state:
444
-		action = getattr(actionsFSMlist, check_state)
445
-		actionPlayer(action)
446
-		if own['stateTimer'] > 70:
447
-			newState = 'fak_roll'			
448
-	
449
-	check_state = 'fak_powerslide'
450
-	if aState == check_state:
451
-		action = getattr(actionsFSMlist, check_state)
452
-		# if own['stateTimer'] < 20:
453
-		# 	actionPlayer(actionsFSMlist.fak_powerslide_in)
454
-		if own['stateTimer'] < getattr(action, 'intro_frames'):	
455
-			intro = getattr(action, 'intro')
456
-			actionPlayer(getattr(actionsFSMlist, intro))	
457
-		else:
445
+		check_state = 'fak_push_goof'
446
+		if aState == check_state:
447
+			action = getattr(actionsFSMlist, check_state)
458
 			actionPlayer(action)
448
 			actionPlayer(action)
459
-		newState = check_exit(aState, rA, timer, actionsFSMlist.fak_powerslide)
460
-
461
-	check_state = 'fak_fs_powerslide'
462
-	if aState == check_state:
463
-		action = getattr(actionsFSMlist, check_state)
464
-		# if own['stateTimer'] < 20:
465
-		# 	actionPlayer(actionsFSMlist.fak_fs_powerslide_in)
466
-		if own['stateTimer'] < getattr(action, 'intro_frames'):	
467
-			intro = getattr(action, 'intro')
468
-			actionPlayer(getattr(actionsFSMlist, intro))	
449
+			if own['stateTimer'] > 70:
450
+				newState = 'fak_roll'			
451
+		
452
+		check_state = 'fak_powerslide'
453
+		if aState == check_state:
454
+			action = getattr(actionsFSMlist, check_state)
455
+			# if own['stateTimer'] < 20:
456
+			# 	actionPlayer(actionsFSMlist.fak_powerslide_in)
457
+			if own['stateTimer'] < getattr(action, 'intro_frames'):	
458
+				intro = getattr(action, 'intro')
459
+				actionPlayer(getattr(actionsFSMlist, intro))	
460
+			else:
461
+				actionPlayer(action)
462
+			newState = check_exit(aState, rA, timer, actionsFSMlist.fak_powerslide)
463
+
464
+		check_state = 'fak_fs_powerslide'
465
+		if aState == check_state:
466
+			action = getattr(actionsFSMlist, check_state)
467
+			# if own['stateTimer'] < 20:
468
+			# 	actionPlayer(actionsFSMlist.fak_fs_powerslide_in)
469
+			if own['stateTimer'] < getattr(action, 'intro_frames'):	
470
+				intro = getattr(action, 'intro')
471
+				actionPlayer(getattr(actionsFSMlist, intro))	
472
+			else:
473
+				actionPlayer(action)
474
+			newState = check_exit(aState, rA, timer, actionsFSMlist.fak_fs_powerslide)				
475
+
476
+
477
+		#-----------------------
478
+		#print(own['aState'], newState, rA, own['l_aState'])
479
+		#print()
480
+		if newState != '':
481
+			own['aState'] = newState 
482
+		own['l_aState'] = og_state
483
+		own['l_actionState'] = og_state
484
+		state_timer(own)
485
+		skater = dict['p1']
486
+		
487
+		if own['requestAction'] == 'reg_roll' and own['rotz'] < .985:
488
+			frame = int(own['rotz'] * 70) 
469
 		else:
489
 		else:
470
-			actionPlayer(action)
471
-		newState = check_exit(aState, rA, timer, actionsFSMlist.fak_fs_powerslide)				
472
-
473
-
474
-	#-----------------------
475
-	#print(own['aState'], newState, rA)
476
-	#print()
477
-	if newState != '':
478
-		own['aState'] = newState 
479
-	own['l_aState'] = og_state
480
-	own['l_actionState'] = og_state
481
-	state_timer(own)
482
-	skater = dict['p1']
483
-	
484
-	if own['requestAction'] == 'reg_roll' and own['rotz'] < .985:
485
-		frame = int(own['rotz'] * 70) 
486
-	else:
487
-		skater.stopAction(5)	
490
+			skater.stopAction(5)	
488
 
491
 
489
-	#own['eaState'].Execute()
492
+		#own['eaState'].Execute()
493
+		#print(dict['walking'], 'walk')

+ 24
- 19
scripts/actionsFSMlist.py View File

191
 
191
 
192
 reg_jump = a_class(
192
 reg_jump = a_class(
193
 	#player armature action name, start, end frames
193
 	#player armature action name, start, end frames
194
-	'reg_jump', 1, 10,
194
+	#'reg_jump', 1, 10,
195
+	'a_jump_t', 9, 27,
195
 	#deck action name, start, end frames  
196
 	#deck action name, start, end frames  
196
-	'b_reg_jump', 1, 10,
197
+	'b_reg_jump', 1, 5,
197
 	#layer, speed, mode (0 = play, 1 = loop), blendin
198
 	#layer, speed, mode (0 = play, 1 = loop), blendin
198
-	1, .5, 0, 10,
199
+	3, .75, 0, 5,
199
 	#intro, length
200
 	#intro, length
200
 	None, 0,
201
 	None, 0,
201
 	#exits
202
 	#exits
202
 	['reg_idle', 'reg_walk_air', 'reg_onboard'],
203
 	['reg_idle', 'reg_walk_air', 'reg_onboard'],
203
 	#force exit, frame
204
 	#force exit, frame
204
-	'reg_walk_air', 20,
205
+	'reg_walk_air', 12,
205
 	#opposite
206
 	#opposite
206
 	None)
207
 	None)
207
 
208
 
208
 reg_walk_air = a_class(
209
 reg_walk_air = a_class(
209
 	#player armature action name, start, end frames
210
 	#player armature action name, start, end frames
210
-	'reg_walk_air', 10, 10,
211
+	#'reg_walk_air', 10, 10,
212
+	'a_jump_t', 27, 27,
211
 	#deck action name, start, end frames  
213
 	#deck action name, start, end frames  
212
 	'b_reg_walk_air', 10, 10,
214
 	'b_reg_walk_air', 10, 10,
213
 	#layer, speed, mode (0 = play, 1 = loop), blendin
215
 	#layer, speed, mode (0 = play, 1 = loop), blendin
225
 
227
 
226
 reg_walk_air_out = a_class(
228
 reg_walk_air_out = a_class(
227
 	#player armature action name, start, end frames
229
 	#player armature action name, start, end frames
228
-	'reg_walk_air', 10, 40,
230
+	#'reg_walk_air', 10, 40,
231
+	'a_jump_t', 27, 49,
229
 	#deck action name, start, end frames  
232
 	#deck action name, start, end frames  
230
 	'b_reg_walk_air', 10, 40,
233
 	'b_reg_walk_air', 10, 40,
231
 	#layer, speed, mode (0 = play, 1 = loop), blendin
234
 	#layer, speed, mode (0 = play, 1 = loop), blendin
236
 	#['reg_idle', 'reg_walk', 'reg_walkFast', 'reg_onboard'],
239
 	#['reg_idle', 'reg_walk', 'reg_walkFast', 'reg_onboard'],
237
 	walk_exits,
240
 	walk_exits,
238
 	#force exit, frame
241
 	#force exit, frame
239
-	'reg_idle', 10,
242
+	'reg_idle', 20,
240
 	#opposite
243
 	#opposite
241
 	None)
244
 	None)
242
 
245
 
317
 	#intro, length
320
 	#intro, length
318
 	None, 0,
321
 	None, 0,
319
 	#exits
322
 	#exits
320
-	['reg_idle', 'reg_offboard', 'reg_turnLeft', 'reg_turnRight', 'reg_opos', 'reg_nopos', 'reg_pump', 'reg_push', 'reg_push_goof', 'reg_powerslide', 'reg_fs_powerslide', 'reg_manual', 'reg_nmanual', 'reg_air', 'reg_air_nose', 'reg_air_tail', 'reg_manual_left', 'reg_manual_right', 'reg_nmanual_left', 'reg_nmanual_right', 'reg_stop'],
323
+	['reg_idle', 'fak_offboard' 'reg_offboard', 'reg_turnLeft', 'reg_turnRight', 'reg_opos', 'reg_nopos', 'reg_pump', 'reg_push', 'reg_push_goof', 'reg_powerslide', 'reg_fs_powerslide', 'reg_manual', 'reg_nmanual', 'reg_air', 'reg_air_nose', 'reg_air_tail', 'reg_manual_left', 'reg_manual_right', 'reg_nmanual_left', 'reg_nmanual_right', 'reg_stop'],
321
 	#force exit, frame
324
 	#force exit, frame
322
 	None, 0,
325
 	None, 0,
323
 	#opposite
326
 	#opposite
2528
 
2531
 
2529
 fak_offboard = a_class(
2532
 fak_offboard = a_class(
2530
 	#player armature action name, start, end frames
2533
 	#player armature action name, start, end frames
2531
-	'fak_noffboard', 1, 30,
2534
+	'fak_noffboard', 1, 24,
2535
+	#'fak_noffboard', 
2532
 	#deck action name, start, end frames  
2536
 	#deck action name, start, end frames  
2533
-	'b_fak_offboard', 1, 30,
2537
+	'b_reg_offboard', 1, 30,
2534
 	#layer, speed, mode (0 = play, 1 = loop), blendin
2538
 	#layer, speed, mode (0 = play, 1 = loop), blendin
2535
-	4, .5, 0, 5,
2539
+	2, .5, 0, 0,
2536
 	#intro, length
2540
 	#intro, length
2537
 	None, 0,
2541
 	None, 0,
2538
 	#exits
2542
 	#exits
2539
-	['fak_idle', 'fak_walkFast', 'fak_walk', 'fak_onboard'],
2543
+	['reg_idle', 'fak_idle', 'fak_walkFast', 'fak_walk', 'fak_onboard'],
2540
 	#force exit, frame
2544
 	#force exit, frame
2541
-	'fak_idle', 28,
2545
+	'reg_idle', 24,
2542
 	#opposite
2546
 	#opposite
2543
 	None)
2547
 	None)
2544
 
2548
 
2552
 	#intro, length
2556
 	#intro, length
2553
 	None, 0,
2557
 	None, 0,
2554
 	#exits
2558
 	#exits
2555
-	['fak_idle', 'fak_offboard', 'fak_turnLeft', 'fak_turnRight', 'fak_opos', 'fak_nopos', 'fak_pump', 'fak_push', 'fak_push_goof', 'fak_powerslide', 'fak_fs_powerslide', 'fak_manual', 'fak_nmanual', 'fak_air', 'fak_air_nose', 'fak_air_tail', 'fak_manual_left', 'fak_manual_right', 'fak_nmanual_left', 'fak_nmanual_right'],
2559
+	['fak_idle', 'fak_offboard', 'reg_offboard','fak_turnLeft', 'fak_turnRight', 'fak_opos', 'fak_nopos', 'fak_pump', 'fak_push', 'fak_push_goof', 'fak_powerslide', 'fak_fs_powerslide', 'fak_manual', 'fak_nmanual', 'fak_air', 'fak_air_nose', 'fak_air_tail', 'fak_manual_left', 'fak_manual_right', 'fak_nmanual_left', 'fak_nmanual_right'],
2556
 	#force exit, frame
2560
 	#force exit, frame
2557
 	None, 0,
2561
 	None, 0,
2558
 	#opposite
2562
 	#opposite
2559
 	'reg_roll')
2563
 	'reg_roll')
2560
 
2564
 
2565
+#not working
2561
 fak_turnLeft = a_class(
2566
 fak_turnLeft = a_class(
2562
 	#player armature action name, start, end frames
2567
 	#player armature action name, start, end frames
2563
 	'nfak_left', 10, 30,
2568
 	'nfak_left', 10, 30,
2568
 	#intro, length
2573
 	#intro, length
2569
 	None, 0,
2574
 	None, 0,
2570
 	#exits
2575
 	#exits
2571
-	['fak_roll', 'fak_opos', 'fak_nopos', 'fak_pump', 'fak_pump_left', 'fak_pump_right', 'fak_push', 'fak_push_goof', 'fak_powerslide', 'fak_fs_powerslide', 'fak_manual', 'fak_nmanual', 'fak_offboard', 'fak_air', 'fak_air_nose', 'fak_air_tail', 'fak_manual_left', 'fak_manual_right', 'fak_nmanual_left', 'fak_nmanual_right', 'reg_turnRight'],
2576
+	['fak_turnRight', 'fak_roll', 'fak_opos', 'fak_nopos', 'fak_pump', 'fak_pump_left', 'fak_pump_right', 'fak_push', 'fak_push_goof', 'fak_powerslide', 'fak_fs_powerslide', 'fak_manual', 'fak_nmanual', 'fak_offboard', 'fak_air', 'fak_air_nose', 'fak_air_tail', 'fak_manual_left', 'fak_manual_right', 'fak_nmanual_left', 'fak_nmanual_right', 'reg_turnRight'],
2572
 	#force exit, frame
2577
 	#force exit, frame
2573
 	None, 0,
2578
 	None, 0,
2574
 	#opposite
2579
 	#opposite
2584
 	#intro, length
2589
 	#intro, length
2585
 	None, 0,
2590
 	None, 0,
2586
 	#exits
2591
 	#exits
2587
-	['fak_roll', 'fak_opos', 'fak_nopos', 'fak_pump', 'fak_pump_left', 'fak_pump_right', 'fak_push', 'fak_push_goof', 'fak_powerslide', 'fak_fs_powerslide', 'fak_manual', 'fak_nmanual', 'fak_offboard', 'fak_air', 'fak_air_nose', 'fak_air_tail', 'fak_manual_left', 'fak_manual_right', 'fak_nmanual_left', 'fak_nmanual_right', 'reg_turnLeft'],
2592
+	['fak_turnLeft', 'fak_roll', 'fak_opos', 'fak_nopos', 'fak_pump', 'fak_pump_left', 'fak_pump_right', 'fak_push', 'fak_push_goof', 'fak_powerslide', 'fak_fs_powerslide', 'fak_manual', 'fak_nmanual', 'fak_offboard', 'fak_air', 'fak_air_nose', 'fak_air_tail', 'fak_manual_left', 'fak_manual_right', 'fak_nmanual_left', 'fak_nmanual_right', 'reg_turnLeft'],
2588
 	#force exit, frame
2593
 	#force exit, frame
2589
 	None, 0,
2594
 	None, 0,
2590
 	#opposite
2595
 	#opposite
3837
 	#player armature action name, start, end frames
3842
 	#player armature action name, start, end frames
3838
 	'fak_BS_Board2', 1, 40,
3843
 	'fak_BS_Board2', 1, 40,
3839
 	#deck action name, start, end frames  
3844
 	#deck action name, start, end frames  
3840
-	'b_reg', 1, 40,
3845
+	'b_fak_bsboard', 1, 40,
3841
 	#layer, speed, mode (0 = play, 1 = loop), blendin
3846
 	#layer, speed, mode (0 = play, 1 = loop), blendin
3842
 	1, 1, 0, 10,
3847
 	1, 1, 0, 10,
3843
 	#intro, length
3848
 	#intro, length
3853
 	#player armature action name, start, end frames
3858
 	#player armature action name, start, end frames
3854
 	'fak_BS_Board2', 41, 80,
3859
 	'fak_BS_Board2', 41, 80,
3855
 	#deck action name, start, end frames  
3860
 	#deck action name, start, end frames  
3856
-	'b_reg', 1, 1,
3861
+	'b_fak_bsboard', 1, 40,
3857
 	#layer, speed, mode (0 = play, 1 = loop), blendin
3862
 	#layer, speed, mode (0 = play, 1 = loop), blendin
3858
 	1, .5, 1, 15,
3863
 	1, .5, 1, 15,
3859
 	#intro, length
3864
 	#intro, length
3869
 	#player armature action name, start, end frames
3874
 	#player armature action name, start, end frames
3870
 	'fak_FS_Board2', 1, 40,
3875
 	'fak_FS_Board2', 1, 40,
3871
 	#deck action name, start, end frames  
3876
 	#deck action name, start, end frames  
3872
-	'b_reg', 1, 40,
3877
+	'b_fak_bsboard', 1, 40,
3873
 	#layer, speed, mode (0 = play, 1 = loop), blendin
3878
 	#layer, speed, mode (0 = play, 1 = loop), blendin
3874
 	1, 1, 0, 10,
3879
 	1, 1, 0, 10,
3875
 	#intro, length
3880
 	#intro, length

+ 15
- 3
scripts/boneRecord.py View File

4
 dict = bge.logic.globalDict
4
 dict = bge.logic.globalDict
5
 dict['replay_record_length']
5
 dict['replay_record_length']
6
 
6
 
7
-bone_list = ["foot.ik.R", "foot.ik.L", "knee.pt.ik.R", "knee.pt.ik.L", "hips", "root", "spine", "spine-1", "chest", "chest-1", "clavicle.L", "clavicle.R", "deltoid.L", "deltoid.R", "upper_arm.fk.L", "upper_arm.fk.R",  "forearm.fk.L", "forearm.fk.R", "hand.fk.L", "hand.fk.R", "neck", "head", "master"]
7
+bone_list = ["foot.ik.R", "foot.ik.L", "knee.pt.ik.R", "knee.pt.ik.L", "hips", "root", "spine", "spine-1", "chest", "chest-1", "clavicle.L", "clavicle.R", "deltoid.L", "deltoid.R", "upper_arm.fk.L", "upper_arm.fk.R",  "forearm.fk.L", "forearm.fk.R", "hand.fk.L", "hand.fk.R", "neck", "head", "master", 
8
+    'foot.rev.R', 'foot.rev.L', 'shin.ik.R', 'shin.ik.L', 'toe.rev.R', 'toe.rev.L']
8
 
9
 
9
 deck_list = ['main', 'turn']
10
 deck_list = ['main', 'turn']
10
 
11
 
11
 #bone_list = ['root', 'head']
12
 #bone_list = ['root', 'head']
12
 
13
 
13
-def Record():    
14
+def Record():   
15
+    #print('bone recording') 
14
     scene = bge.logic.getCurrentScene()
16
     scene = bge.logic.getCurrentScene()
15
     #own = cont.owner
17
     #own = cont.owner
16
     master = scene.objects['control_cube.002']
18
     master = scene.objects['control_cube.002']
17
     cam = scene.objects['Camera.003']
19
     cam = scene.objects['Camera.003']
18
     armature = scene.objects['Char4']
20
     armature = scene.objects['Char4']
19
     deck = scene.objects['deck_arm']
21
     deck = scene.objects['deck_arm']
20
-    #print('bone recording')
21
     if 'dataList' not in master:
22
     if 'dataList' not in master:
22
         for x in bone_list:
23
         for x in bone_list:
23
             master['dataList'] = True
24
             master['dataList'] = True
49
         master[str(y) + '-pos'].append(pos)
50
         master[str(y) + '-pos'].append(pos)
50
         master[str(y) + '-rot'].append(rot)
51
         master[str(y) + '-rot'].append(rot)
51
 
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
+
52
 
64
 
53
 
65
 
54
     for y in deck_list:
66
     for y in deck_list:

+ 3
- 4
scripts/camera.py View File

250
 
250
 
251
 ################
251
 ################
252
     multer = .02
252
     multer = .02
253
-    if dict['walk'] == 1 and not controlcube['ragdoll_active']:
253
+    if dict['walk'] == 1 and controlcube['ragdoll_active'] == False:
254
         if dict['cur_ccH_targetHeight'] < dict['cam_walk_height']:
254
         if dict['cur_ccH_targetHeight'] < dict['cam_walk_height']:
255
             dist = dict['cam_walk_height'] - dict['cur_ccH_targetHeight']
255
             dist = dict['cam_walk_height'] - dict['cur_ccH_targetHeight']
256
 
256
 
262
         cam.max = dict['cam_walk_max']
262
         cam.max = dict['cam_walk_max']
263
 
263
 
264
     else:
264
     else:
265
-
266
         if dict['cur_ccH_targetHeight'] < dict['cch_targetHeight']:
265
         if dict['cur_ccH_targetHeight'] < dict['cch_targetHeight']:
267
             dist = dict['cur_ccH_targetHeight'] - dict['cch_targetHeight']
266
             dist = dict['cur_ccH_targetHeight'] - dict['cch_targetHeight']
268
             dict['cur_ccH_targetHeight'] = dict['cur_ccH_targetHeight'] - (dist * multer)
267
             dict['cur_ccH_targetHeight'] = dict['cur_ccH_targetHeight'] - (dist * multer)
358
     sound_man.main(cont)
357
     sound_man.main(cont)
359
     
358
     
360
     if own['life'] % 2 == 1:
359
     if own['life'] % 2 == 1:
361
-        cars.Execute(cont)
360
+        #cars.Execute(cont)
362
         own['CamFSM'].Execute()
361
         own['CamFSM'].Execute()
363
-        walkers.Execute(cont)
362
+        #walkers.Execute(cont)
364
     else:
363
     else:
365
         pass
364
         pass
366
 
365
 

+ 30
- 11
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
     def fak_stance_left_off():
615
     def fak_stance_left_off():
615
         LAST_LEFT_FAK = own["LAST_LEFT_FAK"]
616
         LAST_LEFT_FAK = own["LAST_LEFT_FAK"]
616
         own["LAST_LEFT_FAK"] = 0
617
         own["LAST_LEFT_FAK"] = 0
623
                 own['requestAction'] = 'fak_turnRight'
624
                 own['requestAction'] = 'fak_turnRight'
624
             LAST_RIGHT_FAK = own["LAST_RIGHT_FAK"]
625
             LAST_RIGHT_FAK = own["LAST_RIGHT_FAK"]
625
             own["LAST_RIGHT_FAK"] = 1
626
             own["LAST_RIGHT_FAK"] = 1
627
+
626
     def fak_stance_right_off():
628
     def fak_stance_right_off():
627
         LAST_RIGHT_FAK = own["LAST_RIGHT_FAK"]
629
         LAST_RIGHT_FAK = own["LAST_RIGHT_FAK"]
628
         own["LAST_RIGHT_FAK"] = 0
630
         own["LAST_RIGHT_FAK"] = 0
1652
 
1654
 
1653
         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:
1654
             #pass
1656
             #pass
1655
-            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)
1656
         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:
1657
 
1661
 
1658
             distance = own.getDistanceTo(gray.hitPosition)
1662
             distance = own.getDistanceTo(gray.hitPosition)
3385
                     pass
3389
                     pass
3386
 
3390
 
3387
     def getoffboard():
3391
     def getoffboard():
3388
-        lasty = own['lasty']
3392
+        #lasty = own['lasty']
3393
+        lasty = dict['last_yBut']
3389
         getoffboard = own['getoffboard']
3394
         getoffboard = own['getoffboard']
3390
-        if getoffboard == 1 and own['fall'] == False:
3391
-            own['getoffboard'] = 0
3392
-        if (yBut == False and lasty == True) or dict['kb_q'] == 3:
3395
+        # if getoffboard == 1 and own['fall'] == False:
3396
+        #     own['getoffboard'] = 0
3397
+        # if (yBut == False and lasty == True) or dict['kb_q'] == 3:
3398
+        #     own['getoffboard'] = 1
3399
+
3400
+        if (yBut == True and lasty == False) or dict['kb_q'] == 3:
3393
             own['getoffboard'] = 1
3401
             own['getoffboard'] = 1
3394
 
3402
 
3403
+
3404
+
3395
     def switchcam():
3405
     def switchcam():
3396
         pass
3406
         pass
3397
     #    if ltsBut == False and own['lastlts'] == True and rtsBut == False:
3407
     #    if ltsBut == False and own['lastlts'] == True and rtsBut == False:
3945
 
3955
 
3946
     def wallride_sound():
3956
     def wallride_sound():
3947
         sact = own.actuators["wallSound"]
3957
         sact = own.actuators["wallSound"]
3958
+        # if 'aState' not in own:
3959
+        #     own['aState'] = ''
3948
         if  own['aState'] in ['reg_wall_r', 'reg_wall_l', 'fak_wall_r', 'fak_wall_l'] and not skater.isPlayingAction(3):
3960
         if  own['aState'] in ['reg_wall_r', 'reg_wall_l', 'fak_wall_r', 'fak_wall_l'] and not skater.isPlayingAction(3):
3949
             sact.volume = .2
3961
             sact.volume = .2
3950
             cont.activate(own.actuators["wallSound"])
3962
             cont.activate(own.actuators["wallSound"])
4257
             own.alignAxisToVect([0.0, 0.0, 1.0], 2, .05)  
4269
             own.alignAxisToVect([0.0, 0.0, 1.0], 2, .05)  
4258
         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)):
4259
             own['vert'] = 1
4271
             own['vert'] = 1
4260
-            print('vert hit')
4272
+            #print('vert hit')
4261
             ud_sens = .04      
4273
             ud_sens = .04      
4262
             if 'spine' in localRay_v[0] and lUD < -.04:
4274
             if 'spine' in localRay_v[0] and lUD < -.04:
4263
                 if STANCE == True:
4275
                 if STANCE == True:
4264
-                    own.applyRotation([0,.15,0], True)
4276
+                    #own.applyRotation([0,.15,0], True)
4277
+                    own.applyRotation([0,.1,0], True)
4265
                 else:    
4278
                 else:    
4266
-                    own.applyRotation([0,-.15,0], True)
4267
-                own.linearVelocity.x *= .97  
4279
+                    #own.applyRotation([0,-.15,0], True)
4280
+                    own.applyRotation([0,-.1,0], True)
4281
+                #own.linearVelocity.x *= .97  
4282
+                own.linearVelocity.x *= .95
4268
             
4283
             
4269
             elif lUD > -ud_sens: 
4284
             elif lUD > -ud_sens: 
4270
                 own['last_vert_frame'] = own['framenum']
4285
                 own['last_vert_frame'] = own['framenum']
4277
                         own.localLinearVelocity.z = 0
4292
                         own.localLinearVelocity.z = 0
4278
                     own.applyMovement((0, 0, (.295 - (localHitDist))), True)
4293
                     own.applyMovement((0, 0, (.295 - (localHitDist))), True)
4279
                     if localRay_v[2] != [0, 0, -1]:    
4294
                     if localRay_v[2] != [0, 0, -1]:    
4280
-                        own.alignAxisToVect(localRay_v[2], 2, .5)
4295
+                        #own.alignAxisToVect(localRay_v[2], 2, .5)
4296
+                        own.alignAxisToVect(localRay_v[2], 2, .15)
4281
                         aligned = True
4297
                         aligned = True
4298
+                # elif localHitDist > .4 and localHitDist < 1.5:
4299
+                #     own.applyMovement((0, 0, (.295 - (localHitDist))), True)
4282
             else:
4300
             else:
4283
                 own.alignAxisToVect([0,0,1], 2, .1)
4301
                 own.alignAxisToVect([0,0,1], 2, .1)
4284
-                print('doing nothing')            
4302
+                #print('doing nothing')            
4285
 
4303
 
4286
     localHitDist = 1000
4304
     localHitDist = 1000
4287
     raytof = scene.objects['rayTo_f']
4305
     raytof = scene.objects['rayTo_f']
4319
     elif own['actionState'] in ['fak_backside_grab_out', 'fak_frontside_grab_out', 'fak_frontside_nose_grab_out', 'fak_frontside_tail_grab_out', 'fak_backside_nose_grab_out', 'fak_backside_tail_grab_out', 'fak_walk_air_out', 'fak_air-walk_air', 'fak_judo_out', 'fak_frigid_out', 'fak_fsonefoot_out', 'fak_onefoot_out'] and own['requestAction'] in  ['reg_land', 'fak_land']:
4337
     elif own['actionState'] in ['fak_backside_grab_out', 'fak_frontside_grab_out', 'fak_frontside_nose_grab_out', 'fak_frontside_tail_grab_out', 'fak_backside_nose_grab_out', 'fak_backside_tail_grab_out', 'fak_walk_air_out', 'fak_air-walk_air', 'fak_judo_out', 'fak_frigid_out', 'fak_fsonefoot_out', 'fak_onefoot_out'] and own['requestAction'] in  ['reg_land', 'fak_land']:
4320
         own['requestAction'] = 'fak_land'   
4338
         own['requestAction'] = 'fak_land'   
4321
 
4339
 
4340
+    #print(own['getonboard'], 'controller geton', '--controller running')

+ 37
- 0
scripts/game.py View File

1
+import bge
2
+import FSM
3
+import requests
4
+import platform
5
+import os
6
+
7
+def phone_home():
8
+	url = 'https://shuvit.org/phone_home.php'
9
+	n = platform.uname()
10
+	n = platform.platform()
11
+	myobj = {'somekey': n}
12
+	x = requests.post(url, data = myobj, timeout=3.50)
13
+	print('phone home response')
14
+	print(x.text)
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
+
23
+def main(cont):
24
+	own = cont.owner
25
+	dict = bge.logic.globalDict
26
+	if 'game_inited' not in own:
27
+		info = bge.logic.PrintGLInfo()
28
+		own['game_inited'] = True
29
+		own['cont'] = cont
30
+		dict['gameFSM'] = FSM.GameFSM(own)
31
+		dict['game_life'] = 0
32
+		dict['maps'] = get_map_list()
33
+		#phone_home()
34
+	if 'game_life' in dict:
35
+		dict['game_life'] += 1
36
+	dict['gameFSM'].Execute()
37
+	

+ 43
- 40
scripts/grindV2.py View File

129
 
129
 
130
         lineVector = secondary - primary
130
         lineVector = secondary - primary
131
         lineVector2 = primary - secondary
131
         lineVector2 = primary - secondary
132
-        lv_green = Vector(found_green[0][0])
132
+        if found_green != []:
133
+            lv_green = Vector(found_green[0][0])
133
             
134
             
134
         eul = Vector((1, 0, 0)).rotation_difference(lineVector).to_euler()        
135
         eul = Vector((1, 0, 0)).rotation_difference(lineVector).to_euler()        
135
         
136
         
139
         rotation = te.worldOrientation.to_euler()
140
         rotation = te.worldOrientation.to_euler()
140
         if abs(rotation.z) > 3:
141
         if abs(rotation.z) > 3:
141
             te.applyRotation([0, 0, 1.570796*2], True)
142
             te.applyRotation([0, 0, 1.570796*2], True)
142
-        #te.alignAxisToVect(worldY, 1, 1)
143
-        #print(te.worldOrientation, 'world orientation')
144
-
145
-
143
+        
146
         xyz = te.localOrientation.to_euler()
144
         xyz = te.localOrientation.to_euler()
147
         xyz[0] = math.radians(0)
145
         xyz[0] = math.radians(0)
148
         te.localOrientation = xyz.to_matrix()
146
         te.localOrientation = xyz.to_matrix()
149
 
147
 
150
-
151
-
152
-
153
         if lineVector == Vector([0.0, 0.0, 0.0]):
148
         if lineVector == Vector([0.0, 0.0, 0.0]):
154
             #print('vector is empty')
149
             #print('vector is empty')
155
             pass
150
             pass
157
             te.alignAxisToVect(lineVector, 0, 1)
152
             te.alignAxisToVect(lineVector, 0, 1)
158
         
153
         
159
         te.worldPosition = primary
154
         te.worldPosition = primary
160
-        
161
-        local = te.worldOrientation.inverted() * (lv_green - te.worldPosition)
162
-        if local.y < 0:
163
-            #print('flip vector')
164
-            eul = Vector((1, 0, 0)).rotation_difference(lineVector2).to_euler() 
165
-            if lineVector2 == Vector([0.0, 0.0, 0.0]):
166
-                #print('linVector2 is empty')
167
-                pass
155
+
156
+        if found_green != []:
157
+            local = te.worldOrientation.inverted() * (lv_green - te.worldPosition)
158
+            if local.y < 0:
159
+                #print('flip vector')
160
+                eul = Vector((1, 0, 0)).rotation_difference(lineVector2).to_euler() 
161
+                if lineVector2 == Vector([0.0, 0.0, 0.0]):
162
+                    #print('linVector2 is empty')
163
+                    pass
164
+                else:
165
+                    te.alignAxisToVect(lineVector2, 0, 1)
166
+                #print('align2', lineVector2)
167
+                te.worldPosition = secondary
168
             else:
168
             else:
169
-                te.alignAxisToVect(lineVector2, 0, 1)
170
-            #print('align2', lineVector2)
171
-            te.worldPosition = secondary
172
-        else:
173
-            #print('align1', lineVector)  
174
-            pass
169
+                #print('align1', lineVector)  
170
+                pass
175
 
171
 
176
 
172
 
177
         #flip z axis
173
         #flip z axis
334
 
330
 
335
         #print(own['inverting'])
331
         #print(own['inverting'])
336
         #if frames_grinding > 20 and own['inverting'] == False:
332
         #if frames_grinding > 20 and own['inverting'] == False:
337
-        if frames_grinding > 20:    
338
-            #print("setting stance")
339
-            if (rot == 90 or rot == -270) and STANCE == True:
340
-                #print("90 fak stance")
341
-                own['stance'] = 1
342
-                STANCE = 1
343
-            if (rot == 90 or rot == -270) and STANCE == False:
344
-                #print("90 fak stance")
345
-                own['stance'] = 1
346
-                STANCE = 1
347
-            if (rot == -90 or rot == 270) and STANCE == True:
348
-                #print("-90 reg stance")
349
-                own['stance'] = 0
350
-                STANCE = 0
351
-            if (rot == -90 or rot == 270) and STANCE == False:
352
-                #print("-90 reg stance")
353
-                own['stance'] = 0
354
-                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
355
 
358
 
356
     def grindrotvel(obj):
359
     def grindrotvel(obj):
357
         joinit = 0
360
         joinit = 0

+ 1
- 1
scripts/inputs.py View File

311
             cube.restoreDynamics()
311
             cube.restoreDynamics()
312
             print(cube.isSuspendDynamics)
312
             print(cube.isSuspendDynamics)
313
 
313
 
314
-main()
314
+#main()
315
 
315
 

+ 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
+    

+ 2
- 19
scripts/logo_fades.py View File

1
 import bge
1
 import bge
2
-import Settings
2
+#import Settings
3
 
3
 
4
 def main():
4
 def main():
5
 
5
 
9
     scene = bge.logic.getCurrentScene()
9
     scene = bge.logic.getCurrentScene()
10
     black = scene.objects['black']
10
     black = scene.objects['black']
11
     shuvit_logo = scene.objects['shuvit_logo']
11
     shuvit_logo = scene.objects['shuvit_logo']
12
-    levels = ['garage18', 'mini_scene']
13
     scenes = bge.logic.getSceneList()
12
     scenes = bge.logic.getSceneList()
14
-    #print(dict['load_timer'])
15
     
13
     
16
     if dict['overlay_fadein'] == 1:
14
     if dict['overlay_fadein'] == 1:
17
-        #dict['overlay_fadein'] = 0
18
-        #black.playAction('black_fade', 0,60, layer=0, play_mode=0)
19
-        #print("---add fade")
20
-        #fade_in
21
-        
22
         for i in scenes:
15
         for i in scenes:
23
             if i.name == "fade_in":
16
             if i.name == "fade_in":
24
                 scene2 = i
17
                 scene2 = i
25
                 scene2.end()         
18
                 scene2.end()         
26
         cont.activate(own.actuators['add_fade'])  
19
         cont.activate(own.actuators['add_fade'])  
27
         
20
         
28
-        #skater.playAction("reg_noses", 30,40, layer=trans_layer, play_mode=0, speed=.5)
29
     if dict['overlay_fadeout'] == 1:
21
     if dict['overlay_fadeout'] == 1:
30
         dict['overlay_fadeout'] = 0    
22
         dict['overlay_fadeout'] = 0    
31
         black.playAction('black_fade', 100,200, layer=2, play_mode=0) 
23
         black.playAction('black_fade', 100,200, layer=2, play_mode=0) 
32
         shuvit_logo.playAction('logo_fade', 100,200, layer=0, play_mode=0)  
24
         shuvit_logo.playAction('logo_fade', 100,200, layer=0, play_mode=0)  
33
-        #print('fade out black and logo') 
34
         
25
         
35
     if dict['load_timer'] > 0:
26
     if dict['load_timer'] > 0:
36
         dict['load_timer'] -= 1
27
         dict['load_timer'] -= 1
37
     if dict['load_timer'] == 3:
28
     if dict['load_timer'] == 3:
38
-        #load   
39
         scenes = bge.logic.getSceneList()
29
         scenes = bge.logic.getSceneList()
40
-        #print('scenes: ', scenes)
41
 
30
 
42
-                 
43
-        #Settings.loadlevel()
44
-        #print('----reloading----')
45
         dict['load_timer'] == 0
31
         dict['load_timer'] == 0
46
         cont.activate(own.actuators['reload_game'])
32
         cont.activate(own.actuators['reload_game'])
47
-        
48
-        #cont.activate(own.actuators["loading"])
49
-        #print('loading', dict['level'])
50
     
33
     
51
-main()
34
+#main()

+ 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)  

+ 565
- 0
scripts/player.py View File

1
+import bge
2
+import FSM
3
+from mathutils import Vector
4
+import math
5
+import mathutils
6
+import random
7
+
8
+dict = bge.logic.globalDict
9
+
10
+class Player:
11
+	def __init__(self, cont):
12
+		self.cont = cont
13
+		self.obj = cont.owner
14
+		self.FSM = FSM.PlayerFSM(self)
15
+		self.walking = True
16
+		self.last_pos = self.obj.worldPosition.copy()
17
+		self.throw_timer = 0
18
+		self.throw_deck = None
19
+		self.throw_deck_empty = self.obj.childrenRecursive["throw_deck_empty"]
20
+		self.step = True
21
+		self.dropin_obj = None
22
+		self.joystick_active_frame = 0
23
+		self.joystick_idle = False
24
+		self.idle_cam_dir = True
25
+		#self.throw_deck_obj = dict['level_scene'].objects['throw_deck']
26
+		dict['walking'] = True
27
+		#print(self.obj.childrenRecursive)
28
+		#self.arm = self.obj.childrenRecursive['Char4']
29
+		self.arm = None
30
+
31
+	def update(self):
32
+		self.FSM.Execute()
33
+		self.last_pos = self.obj.worldPosition.copy()
34
+
35
+	def get_ground_ray(self):
36
+		v = self.obj.worldOrientation.col[0]
37
+		tv = v.normalized()
38
+		axis = 2
39
+		distance = -50
40
+		start = self.obj.worldPosition.copy()
41
+		back_start = start + 0.15 * tv
42
+		start.z += .1
43
+		end = Vector.copy(self.obj.worldPosition + (self.obj.worldOrientation.col[axis] * distance))
44
+		ray = self.obj.rayCast(end, back_start, 0, 'ground', 1, 0, 0, 53247)
45
+		v = self.obj.linearVelocity.copy()
46
+		v = self.obj.worldOrientation.col[0]
47
+		tv = v.normalized()
48
+		front_start = start - 0.30 * tv
49
+		start.z += .1
50
+		front_end = Vector(front_start + (self.obj.worldOrientation.col[axis] * distance))
51
+		frontray = self.obj.rayCast(front_end, front_start, 0, 'ground', 1, 0, 0, 53247)
52
+		#if ray[0] == None and frontray[0] == None:
53
+		cray = self.obj.rayCast(end, start, 0, 'ground', 1, 0, 0, 53247)
54
+
55
+		#bge.render.drawLine(front_start, front_end, [1,0,0])
56
+		#bge.render.drawLine(back_start, end, [0,1,0])
57
+		#bge.render.drawLine(start, end, [0,0,1])
58
+		return [ray, frontray, cray]
59
+
60
+
61
+
62
+	def get_dropin_rays(self):
63
+		v = self.obj.worldOrientation.col[0]
64
+		tv = v.normalized()
65
+		axis = 2
66
+		distance = -50
67
+		start = self.obj.worldPosition.copy()
68
+		back_start = start + 0.1 * tv
69
+		start.z += .1
70
+		end = Vector.copy(self.obj.worldPosition + (self.obj.worldOrientation.col[axis] * distance))
71
+		ray = self.obj.rayCast(end, back_start, 0, 'ground', 1, 0, 0, 53247)
72
+		
73
+		v = self.obj.linearVelocity.copy()
74
+		v = self.obj.worldOrientation.col[0]
75
+		tv = v.normalized()
76
+		front_start = start - 0.1 * tv
77
+		start.z += .1
78
+		front_end = Vector(front_start + (self.obj.worldOrientation.col[axis] * distance))
79
+		frontray = self.obj.rayCast(front_end, front_start, 0, 'ground', 1, 0, 0, 53247)
80
+		cray = self.obj.rayCast(end, start, 0, 'ground', 1, 0, 0, 53247)
81
+		return [ray, frontray, cray]		
82
+
83
+
84
+	def get_hang_ray(self):
85
+
86
+		v = self.obj.worldOrientation.col[0]
87
+		tv = v.normalized()
88
+
89
+		axis = 2
90
+		distance = -5
91
+		start = self.obj.worldPosition.copy()
92
+		start.z += 1.8
93
+		mstart = start - 0.40 * tv
94
+		
95
+		end = Vector(mstart + (self.obj.worldOrientation.col[axis] * distance))
96
+		ray = self.obj.rayCast(end, mstart, 0, 'ground', 1, 1, 0, 53247)
97
+		#ray = self.obj.rayCast(end, mstart, 0, '', 1, 1, 0, 53247)
98
+		#bge.render.drawLine(mstart, end, [0,0,1])
99
+
100
+		return ray
101
+
102
+	def get_hang_align_ray(self):
103
+
104
+		v = self.obj.worldOrientation.col[0]
105
+		tv = v.normalized()
106
+
107
+		axis = 0
108
+		distance = -2
109
+		start = self.obj.worldPosition.copy()
110
+		start.z += 1
111
+		#mstart = start - 0.40 * tv
112
+		#mstart = start * tv
113
+		mstart = start 
114
+
115
+		end = Vector(mstart + (self.obj.worldOrientation.col[axis] * distance))
116
+		#ray = self.obj.rayCast(end, mstart, 0, 'ground', 1, 0, 0, 53247)
117
+		ray = self.obj.rayCast(end, mstart, 0, '', 1, 0, 0, 53247)
118
+		#if ray[0] != None:
119
+			#print(ray[0], 'player funct')
120
+		#bge.render.drawLine(mstart, end, [0,1,0])
121
+		
122
+		return ray
123
+
124
+
125
+
126
+	def get_ground_dist(self, groundray):
127
+		gr = groundray[0]
128
+		fgr = groundray[1]
129
+		cgr = groundray[2]
130
+		d = None
131
+		
132
+		if gr[0] != None:
133
+			p_z = self.obj.worldPosition.z
134
+			g_z = gr[1].z
135
+			distance_to_ground = p_z - g_z
136
+			p2 = None
137
+			if fgr[0] != None:
138
+				p2 = p_z - fgr[1].z 
139
+
140
+				if p2 < distance_to_ground:
141
+					distance_to_ground = p2
142
+			
143
+			if cgr[0] != None:
144
+				p2 = p_z - cgr[1].z 
145
+
146
+				if p2 < distance_to_ground:
147
+					distance_to_ground = p2
148
+
149
+			return distance_to_ground
150
+
151
+
152
+
153
+	def get_hang_dist(self, groundray):
154
+		if groundray[0] != None:
155
+			p_z = self.obj.worldPosition.z
156
+			g_z = groundray[1].z
157
+			distance_to_ground = p_z - g_z
158
+			return distance_to_ground
159
+
160
+
161
+	def set_walk_z(self, dist):
162
+		if dist < .6:
163
+			target_dist = .3
164
+			self.obj.worldPosition.z += (target_dist - dist)
165
+			self.obj.linearVelocity.z = 0
166
+
167
+	def align_walk_z(self):
168
+		self.obj.alignAxisToVect([0,0,1], 2, .08)
169
+
170
+	def walk_movement(self):
171
+		
172
+		moving = False
173
+		o = self.obj
174
+		
175
+
176
+		o.linearVelocity.y *= .9
177
+		o.linearVelocity.x *= .95
178
+
179
+		if dict['kb_w'] == 2 or dict['lUD'] < -.05:
180
+			#walk_blend(self)
181
+
182
+			#run
183
+			if (dict['kb_lsh'] == 2 or dict['aBut'] == 1) and o.linearVelocity.x > -dict['max_run_vel']:
184
+				#self.run_speed = 1.5
185
+				#o.applyForce([-dict['run_force'], 0, 0], True)
186
+				o.linearVelocity.x -= .2
187
+
188
+			#walk
189
+			elif o.linearVelocity.x > -dict['max_walk_vel']:
190
+				#o.applyForce([-dict['walk_force'], 0, 0], True)
191
+				o.linearVelocity.x -= .1
192
+
193
+
194
+		if dict['kb_s'] == 2 or dict['lUD'] > .06:
195
+			#o.applyForce([10, 0, 0], True)
196
+			if o.linearVelocity.x < (dict['max_walk_vel'] / 2):
197
+				o.linearVelocity.x += .05
198
+			#print('w')
199
+
200
+		if dict['kb_a'] == 2 or dict['lLR'] < -.03:
201
+			o.applyRotation([0, 0, dict['walk_turn_amt']], True)
202
+			#print('w')
203
+	
204
+		if dict['kb_d'] == 2 or dict['lLR'] > .03:
205
+			o.applyRotation([0, 0, -dict['walk_turn_amt']], True)
206
+
207
+
208
+
209
+		#print('linvel', o.linearVelocity)
210
+
211
+		return moving
212
+
213
+	def move_walk_cam(self):
214
+		amt = -.05
215
+		amt2 = -.07
216
+		if dict['rLR'] > .04:
217
+			dict['camera'].applyMovement([amt, 0, 0], True)
218
+		elif dict['rLR'] < -.04:
219
+			dict['camera'].applyMovement([-amt, 0, 0], True)	
220
+
221
+		if dict['rUD'] > .04:
222
+			dict['camera'].applyMovement([0, -amt2, 0], True)
223
+		elif dict['rUD'] < -.04:
224
+			dict['camera'].applyMovement([0, amt2, 0], True)	
225
+
226
+	def check_reset_point(self):
227
+		if dict['ddPad'] == 1:
228
+			spawn_pos = self.obj['spawn_pos']
229
+			spawn_rot = self.obj['spawn_rot']
230
+			spawn_cam_pos = self.obj['spawn_cam_pos']
231
+			spawn_cam_rot = self.obj['spawn_cam_rot']
232
+			try:
233
+				self.obj.worldPosition = (spawn_pos[0], spawn_pos[1], (spawn_pos[2] + .1))
234
+				self.obj.worldOrientation = [[spawn_rot[0][0], spawn_rot[0][1],spawn_rot[0][2]], [spawn_rot[1][0],spawn_rot[1][1], spawn_rot[1][2]], [0.0, 0.0, 1.0]]
235
+				dict['camera'].worldPosition = (spawn_cam_pos[0], spawn_cam_pos[1], (spawn_cam_pos[2]))
236
+				dict['camera'].worldOrientation = [[spawn_cam_rot[0][0], spawn_cam_rot[0][1], spawn_cam_rot[0][2]], [spawn_cam_rot[1][0], spawn_cam_rot[1][1], spawn_cam_rot[1][2]], [0.0, 0.0, 1.0]]
237
+			except:
238
+				self.obj.worldPosition = (0, 0, .1)
239
+				self.obj.worldOrientation = [[1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0]]
240
+
241
+			if self.obj["spawn_stance"] == 1:
242
+				self.obj.setLinearVelocity([.1,0,0], 1)
243
+
244
+			else:
245
+				self.obj.setLinearVelocity([-.1,0,0], 1)
246
+
247
+		if dict['udPad'] == 1:
248
+			self.obj['spawn_pos'] = [self.obj.worldPosition[0], self.obj.worldPosition[1], self.obj.worldPosition[2]]
249
+			self.obj['spawn_rot'] = [[self.obj.worldOrientation[0][0], self.obj.worldOrientation[0][1],self.obj.worldOrientation[0][2]], [self.obj.worldOrientation[1][0], self.obj.worldOrientation[1][1], self.obj.worldOrientation[1][2]], self.obj.worldOrientation[2][2]]
250
+			self.obj['spawn_cam_pos'] = [dict['camera'].worldPosition[0], dict['camera'].worldPosition[1], dict['camera'].worldPosition[2]]
251
+			self.obj['spawn_cam_rot'] = [[dict['camera'].worldOrientation[0][0], dict['camera'].worldOrientation[0][1],dict['camera'].worldOrientation[0][2]], [dict['camera'].worldOrientation[1][0], dict['camera'].worldOrientation[1][1], dict['camera'].worldOrientation[1][2]], dict['camera'].worldOrientation[2][2]]
252
+			stance = self.obj["stance"]
253
+			self.obj["spawn_stance"] = stance
254
+
255
+
256
+	def hang_move(self):
257
+		if dict['lLR'] > .04:
258
+			#self.arm.playAction('c_hanghopleft', 0, 45, layer=3, play_mode=0, speed=.75, blendin=10)
259
+			self.arm.playAction('c_shimmy_l', 0, 34, layer=3, play_mode=0, speed=.75, blendin=10)
260
+			self.obj.applyForce([0,235,0], True)
261
+		if dict['lLR'] < -.04:
262
+			#self.arm.playAction('c_hanghopright', 0, 45, layer=3, play_mode=0, speed=.75, blendin=10)
263
+			self.arm.playAction('c_shimmy_r', 0, 34, layer=3, play_mode=0, speed=.75, blendin=10)
264
+			self.obj.applyForce([0,-235,0], True)
265
+
266
+
267
+	def check_throw(self):
268
+
269
+		def throw(strength):
270
+			print('throwing with strength', strength)
271
+			if self.throw_deck != None:
272
+				self.throw_deck.endObject()
273
+				self.throw_deck = None
274
+			self.throw_deck = dict['level_scene'].addObject('throw_deck', self.throw_deck_empty, 0)
275
+			self.throw_deck.worldOrientation = self.throw_deck_empty.worldOrientation
276
+			#self.throw_deck.applyForce([0, 0, -300], True)
277
+			#-z = forward +y = height
278
+			self.throw_deck.applyForce([0, 150, -200], True)
279
+			self.hide_deck()
280
+
281
+		if self.throw_deck == None:	
282
+			strength = self.throw_timer
283
+			
284
+			if strength > 19:
285
+				strength = 19
286
+
287
+			if dict['bBut'] == 0 and dict['last_bBut'] == 1:
288
+				self.throw_timer = 0
289
+				self.arm.playAction('c_throw', 19, 45, layer=7, play_mode=0, speed=.75, blendin=5)
290
+				self.deck_arm.playAction('b_throw', 19, 45, layer=7, play_mode=0, speed=.75, blendin=5)
291
+				throw(strength)
292
+			elif dict['bBut'] == 1:
293
+				self.arm.playAction('c_throw', 0, 45, layer=7, play_mode=1, speed=.75, blendin=5)
294
+				self.deck_arm.playAction('b_throw', 0, 45, layer=7, play_mode=1, speed=.75, blendin=5)
295
+				self.arm.setActionFrame(strength, 7)
296
+				self.deck_arm.setActionFrame(strength, 7)
297
+				self.throw_timer += 1
298
+			else:
299
+				self.throw_timer = 0
300
+		else:
301
+			if dict['bBut'] == 0 and dict['last_bBut'] == 1:
302
+				self.show_deck()
303
+				self.throw_deck.endObject()
304
+				self.throw_deck = None
305
+
306
+	def drop_deck(self):
307
+
308
+		if self.throw_deck == None:	
309
+			self.throw_deck = dict['level_scene'].addObject('throw_deck', self.throw_deck_empty, 0)
310
+			self.throw_deck.worldOrientation = self.throw_deck_empty.worldOrientation
311
+			#self.throw_deck.applyForce([0, 0, -300], True)
312
+			#-z = forward +y = height
313
+			self.throw_deck.applyMovement([-.5, 0, .5], True)
314
+			self.throw_deck.worldPosition.z += .4
315
+			self.throw_deck.applyForce([0, 50, 75], True)
316
+			self.hide_deck()
317
+
318
+		
319
+			
320
+
321
+
322
+
323
+		#if self.throw_timer > 0:
324
+	def hide_deck(self):
325
+		for x in self.deck_arm.childrenRecursive:
326
+			x.visible = False
327
+			
328
+	def show_deck(self):
329
+		for x in self.deck_arm.childrenRecursive:
330
+			x.visible = True
331
+
332
+	def get_vert_rot(self, own, object):
333
+
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
444
+
445
+	def move_to_te(self):
446
+		o = self.obj
447
+		te = dict['level_scene'].objects['temp_empty']
448
+		te.applyRotation([0,0,-3.14/2], True)
449
+		te.worldPosition.z += .3
450
+		o.worldPosition = te.worldPosition
451
+		o.worldOrientation = te.worldOrientation
452
+		o.linearVelocity = [0,0,0]
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
+
554
+
555
+def update(cont):
556
+	#print('-------------player updating----------------')
557
+	dict = bge.logic.globalDict
558
+	#own = cont.owner
559
+
560
+	if 'player_class' not in dict:
561
+		#dict['playerFSM'] = FSM.PlayerFSM(own)
562
+		dict['player_class'] = Player(cont)
563
+
564
+	#dict['playerFSM'].Execute()
565
+	dict['player_class'].update()

+ 58
- 34
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
         
89
     #if (sens.positive) or (dict['aBut'] == 1 and dict['bBut'] == 1) or own['fall'] == True:
90
     #if (sens.positive) or (dict['aBut'] == 1 and dict['bBut'] == 1) or own['fall'] == True:
90
     if (sens.positive) or own['fall'] == True:
91
     if (sens.positive) or own['fall'] == True:
91
         #print('option1')
92
         #print('option1')
92
-        #own['fall'] = True
93
+        own['fall'] = False
93
         if own['ragdoll_active'] == False:
94
         if own['ragdoll_active'] == False:
94
             #own['fall'] = 1
95
             #own['fall'] = 1
95
             own['fall'] = True
96
             own['fall'] = True
96
             print('do ragdoll')
97
             print('do ragdoll')
97
             incer = -1
98
             incer = -1
98
             update_rb(own['rd_rb'], scene)   
99
             update_rb(own['rd_rb'], scene)   
99
-            while incer < 20:
100
-                incer += 1
101
-                scene.objects[armature].stopAction(incer)
100
+            # while incer < 20:
101
+            #     incer += 1
102
+            #     scene.objects[armature].stopAction(incer)
102
             pB = scene.objectsInactive["npc_ed_arm_physBody"]        
103
             pB = scene.objectsInactive["npc_ed_arm_physBody"]        
103
             physBody = own['rd_rb']
104
             physBody = own['rd_rb']
104
             physBody.worldPosition = own.worldPosition
105
             physBody.worldPosition = own.worldPosition
112
             own['ragdoll_active'] = True
113
             own['ragdoll_active'] = True
113
             max_constraints(own, scene, physBody)
114
             max_constraints(own, scene, physBody)
114
             own.visible = False
115
             own.visible = False
116
+            #own.visible = True
115
             own['throw_deck'] = False
117
             own['throw_deck'] = False
116
             cont.actuators['Camera'].height = 2.0
118
             cont.actuators['Camera'].height = 2.0
117
             #cont.actuators['Camera'].min = 14.0
119
             #cont.actuators['Camera'].min = 14.0
118
             #cont.actuators['Camera'].max = 18.0
120
             #cont.actuators['Camera'].max = 18.0
119
             cont.actuators['Camera'].damping = .000001
121
             cont.actuators['Camera'].damping = .000001
120
             cont.activate(cont.actuators['Camera']) 
122
             cont.activate(cont.actuators['Camera']) 
121
-                        
122
-            #own.suspendDynamics()
123
+            own.suspendDynamics(True)
124
+
123
             
125
             
124
     else:
126
     else:
125
 
127
 
126
         if own['ragdoll_active'] == True:
128
         if own['ragdoll_active'] == True:
127
             #pass
129
             #pass
128
-            scene.objects[armature].stopAction(2)
129
-            scene.objects[armature].stopAction(7)
130
-            scene.objects[armature].update()
130
+            own['rd_incer'] += 1
131
+            # scene.objects[armature].stopAction(1)
132
+            # scene.objects[armature].stopAction(2)
133
+            # scene.objects[armature].stopAction(3)
134
+            # scene.objects[armature].stopAction(7)
135
+            #scene.objects[armature].update()
131
             
136
             
132
             #cont.actuators['Camera'].object = scene.objects['ragdoll_parent']
137
             #cont.actuators['Camera'].object = scene.objects['ragdoll_parent']
138
+            
133
             #scene.objects['control_cube.002'].worldPosition = scene.objects['control_cube.002'].worldPosition.lerp(scene.objects['ragdoll_parent'].worldPosition, .01)
139
             #scene.objects['control_cube.002'].worldPosition = scene.objects['control_cube.002'].worldPosition.lerp(scene.objects['ragdoll_parent'].worldPosition, .01)
134
-            scene.objects['control_cube.002'].worldPosition = scene.objects['ragdoll_parent'].worldPosition
135
-
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)
146
+            #print('doing the active thing')
136
 
147
 
137
 
148
 
138
             wp = scene.objects['camCube'].worldPosition - scene.objects['ragdoll_parent'].worldPosition
149
             wp = scene.objects['camCube'].worldPosition - scene.objects['ragdoll_parent'].worldPosition
148
             else:    
159
             else:    
149
                 own['requestAction'] = 'fak_walk'
160
                 own['requestAction'] = 'fak_walk'
150
             if own['rd_set_vel'] == True:
161
             if own['rd_set_vel'] == True:
151
-                print(own['rd_incer'], 'rdincer', own['rd_vel'])
162
+                #print(own['rd_incer'], 'rdincer', own['rd_vel'])
152
                 
163
                 
153
                 scene.objects['npc_ed_arm_phys_master'].setLinearVelocity(own['rd_vel'] * 20, False)
164
                 scene.objects['npc_ed_arm_phys_master'].setLinearVelocity(own['rd_vel'] * 20, False)
154
                 own['rd_set_vel'] = False
165
                 own['rd_set_vel'] = False
160
                     #scene.objects['npc_ed_arm_phys_master'].worldLinearVelocity.x = 100
171
                     #scene.objects['npc_ed_arm_phys_master'].worldLinearVelocity.x = 100
161
                     #scene.objects['npc_ed_arm_phys_master'].applyForce([5000,0,0], False)
172
                     #scene.objects['npc_ed_arm_phys_master'].applyForce([5000,0,0], False)
162
                     for pB in own['rd_rb'].groupMembers:
173
                     for pB in own['rd_rb'].groupMembers:
163
-                        print('setting', pB, own['rd_vel'])
174
+                        #print('setting', pB, own['rd_vel'])
164
                         
175
                         
165
                         try:
176
                         try:
166
                             #pass
177
                             #pass
168
                             #pB.worldLinearVelocity.x = 100
179
                             #pB.worldLinearVelocity.x = 100
169
                             #pB.worldLinearVelocity = own['rd_vel']
180
                             #pB.worldLinearVelocity = own['rd_vel']
170
                             pB.setLinearVelocity(own['rd_vel'], False)
181
                             pB.setLinearVelocity(own['rd_vel'], False)
171
-                            print('adding force to', pB, pB.worldLinearVelocity)
182
+                            #print('adding force to', pB, pB.worldLinearVelocity)
172
                         except:
183
                         except:
173
                             print('cant add force to ', pB)
184
                             print('cant add force to ', pB)
174
                 else:
185
                 else:
183
                 for x in own['rd_rb'].groupMembers:
194
                 for x in own['rd_rb'].groupMembers:
184
                     x.suspendDynamics(True)
195
                     x.suspendDynamics(True)
185
                 own['ragdoll_active'] = False    
196
                 own['ragdoll_active'] = False    
186
-                print(scene.objects[armature].parent, 'parent')
197
+                #print(scene.objects[armature].parent, 'parent')
187
                 cont.actuators['Camera'].object = scene.objects['camCube']
198
                 cont.actuators['Camera'].object = scene.objects['camCube']
188
                 cont.activate(cont.actuators['Camera']) 
199
                 cont.activate(cont.actuators['Camera']) 
189
                 own.worldPosition = scene.objects['npc_ed_arm_phys_master'].worldPosition
200
                 own.worldPosition = scene.objects['npc_ed_arm_phys_master'].worldPosition
190
-                own.worldPosition.z += .4
201
+                own.worldPosition.z += .8#4
191
                 cont.activate(cont.actuators['walk']) 
202
                 cont.activate(cont.actuators['walk']) 
192
-
203
+                own['getonboard'] = True
204
+                dict['walk'] = 0
205
+                own['fall'] = False
206
+                own.alignAxisToVect([0,0,1], 2, .99)
193
             if dict['lUD'] < -.08 and own['rd_incer'] > 200:
207
             if dict['lUD'] < -.08 and own['rd_incer'] > 200:
194
                 physBody = own['rd_rb']
208
                 physBody = own['rd_rb']
195
                 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']
196
                 #excludes = []
210
                 #excludes = []
197
-                for x in physBody.groupMembers:
198
-                    print(x.name)
211
+                # for x in physBody.groupMembers:
212
+                #     print(x.name)
199
                                     
213
                                     
200
-                    if x.name not in excludes:
201
-                        pass
202
-                        #x.applyForce([0,0,15], False)
203
-                    else:
204
-                        #x.applyForce([0,0,100], False)   
205
-                        pass 
214
+                #     if x.name not in excludes:
215
+                #         #pass
216
+                #         x.applyForce([0,0,15], False)
217
+                #     else:
218
+                #         x.applyForce([0,0,100], False)   
219
+                #         #pass 
206
 
220
 
207
-                scene.objects['npc_ed_arm_phys_master'].applyForce([0,0,500], False)
221
+                # scene.objects['npc_ed_arm_phys_master'].applyForce([0,0,500], False)
208
                 scene.objects['npc_ed_arm_phys_head'].applyForce([0,0,400], False)
222
                 scene.objects['npc_ed_arm_phys_head'].applyForce([0,0,400], False)
209
-                scene.objects['npc_ed_arm_phys_chest'].applyForce([0,0,200], False)
223
+                # scene.objects['npc_ed_arm_phys_chest'].applyForce([0,0,200], False)
210
                 scene.objects['npc_ed_arm_phys_chest-1'].applyForce([0,0,200], False)
224
                 scene.objects['npc_ed_arm_phys_chest-1'].applyForce([0,0,200], False)
211
-                scene.objects['npc_ed_arm_phys_spine'].applyForce([0,0,200], False)
225
+                # scene.objects['npc_ed_arm_phys_spine'].applyForce([0,0,200], False)
212
                 scene.objects['npc_ed_arm_phys_neck'].applyForce([0,0,200], False)
226
                 scene.objects['npc_ed_arm_phys_neck'].applyForce([0,0,200], False)
213
-                scene.objects['npc_ed_arm_phys_deltoid.L'].applyForce([0,0,200], False)
214
-                scene.objects['npc_ed_arm_phys_deltoid.R'].applyForce([0,0,200], False)
215
-                scene.objects['npc_ed_arm_phys_clavicle.L'].applyForce([0,0,200], False)
216
-                scene.objects['npc_ed_arm_phys_clavicle.R'].applyForce([0,0,200], False)
227
+                scene.objects['npc_ed_arm_phys_forearm.fk.L'].applyForce([0,0,30], False)
228
+                scene.objects['npc_ed_arm_phys_forearm.fk.R'].applyForce([0,0,30], False)
229
+                
230
+                # scene.objects['npc_ed_arm_phys_deltoid.L'].applyForce([0,0,200], False)
231
+                # scene.objects['npc_ed_arm_phys_deltoid.R'].applyForce([0,0,200], False)
232
+                # scene.objects['npc_ed_arm_phys_clavicle.L'].applyForce([0,0,200], False)
233
+                # scene.objects['npc_ed_arm_phys_clavicle.R'].applyForce([0,0,200], False)
217
 
234
 
218
-            if dict['rUD'] > .08 and own['rd_incer'] > 200:
219
-                scene.objects['npc_ed_arm_phys_master'].applyForce([0,600,0], True)
235
+            if dict['lLR'] < -.04:
236
+                scene.objects['npc_ed_arm_phys_spine'].applyRotation([0,.1,0], True)
237
+                scene.objects['npc_ed_arm_phys_head'].applyRotation([0,.1,0], True)
238
+            if dict['lLR'] > .04:
239
+                scene.objects['npc_ed_arm_phys_spine'].applyRotation([0,-.1,0], True)
240
+                scene.objects['npc_ed_arm_phys_head'].applyRotation([0,-.1,0], True)
241
+                
242
+            # if dict['rUD'] > .08 and own['rd_incer'] > 200:
243
+            #     scene.objects['npc_ed_arm_phys_master'].applyForce([0,600,0], True)
220
         else:
244
         else:
221
             update_rb(own['rd_rb'], scene)   
245
             update_rb(own['rd_rb'], scene)   
222
             #pass
246
             #pass

+ 11
- 4
scripts/scene_init.py View File

15
         
15
         
16
         cam = scene.objects['Camera.003']
16
         cam = scene.objects['Camera.003']
17
         curscene = bge.logic.getCurrentScene()
17
         curscene = bge.logic.getCurrentScene()
18
+        dict['level_scene'] = curscene
18
 
19
 
19
         dict['overlay_fadeout'] = 1
20
         dict['overlay_fadeout'] = 1
20
         scenes = bge.logic.getSceneList()
21
         scenes = bge.logic.getSceneList()
90
             print('starting music') 
91
             print('starting music') 
91
         else:
92
         else:
92
             print('not starting music', dict['music_player'])        
93
             print('not starting music', dict['music_player'])        
93
-            
94
-        for x in scene.objects:
94
+        
95
+        dict['sun_lights'] = []    
96
+        dict['ambient_lights'] = []    
97
+        for x in scene.lights:
95
             if 'hemi' in x:
98
             if 'hemi' in x:
96
                 if 'down' in x:
99
                 if 'down' in x:
97
                     x.energy = dict['ambient_strength']
100
                     x.energy = dict['ambient_strength']
101
+                    dict['ambient_lights'].append(x)
98
                 else:
102
                 else:
99
                     x.energy = dict['ambient_strength'] * .7    
103
                     x.energy = dict['ambient_strength'] * .7    
104
+                    dict['ambient_lights'].append(x)
100
 
105
 
101
             if 'sun' in x:
106
             if 'sun' in x:
102
                 x.energy = dict['sun_strength']
107
                 x.energy = dict['sun_strength']
108
+                dict['sun_lights'].append(x)
103
         #scene.world.envLightEnergy = dict['ambient_strength']   
109
         #scene.world.envLightEnergy = dict['ambient_strength']   
104
-        scene.world.envLightEnergy = 0
110
+        #scene.world.envLightEnergy = 0
105
         
111
         
106
         cam['BC_BRIGHTNESS'] = dict['BC_BRIGHTNESS'] 
112
         cam['BC_BRIGHTNESS'] = dict['BC_BRIGHTNESS'] 
107
         cam['BC_CONTRAST'] = dict['BC_CONTRAST']
113
         cam['BC_CONTRAST'] = dict['BC_CONTRAST']
134
         own['last_roty'] = 0.0
140
         own['last_roty'] = 0.0
135
         
141
         
136
         own['walk_targ_speed'] = 2
142
         own['walk_targ_speed'] = 2
137
-        own['walk_fast_targ_speed'] = 8
143
+        own['walk_fast_targ_speed'] = 5
138
         own['walk_speed'] = 0
144
         own['walk_speed'] = 0
139
         own['walk_inc'] = .2
145
         own['walk_inc'] = .2
140
         own['walk_jump_timer'] = 0
146
         own['walk_jump_timer'] = 0
151
         own['grinding'] = False
157
         own['grinding'] = False
152
         own['ground_since'] = 100
158
         own['ground_since'] = 100
153
         own['last_transition_frame'] = 0
159
         own['last_transition_frame'] = 0
160
+        #own['aState'] = 'reg_roll'
154
         
161
         
155
         colors.update_shirt_tex() 
162
         colors.update_shirt_tex() 
156
         colors.update_truck_tex()
163
         colors.update_truck_tex()

+ 28
- 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
 
10
 	self.pop = sounds('pop')
12
 	self.pop = sounds('pop')
11
 	self.land = sounds('land')
13
 	self.land = sounds('land')
12
 	self.roll = sounds('roll')
14
 	self.roll = sounds('roll')
15
+	self.s_l_1 = sounds('s_l_1')
16
+
17
+	self.s_r_1 = sounds('s_r_1')
18
+	self.s_l_2 = sounds('s_l_2')
19
+	self.s_r_2 = sounds('s_r_2')
20
+	self.s_l_1.volume = 0.3
21
+	self.s_r_1.volume = 0.3
22
+	self.s_l_1.pitch = 3
23
+	self.s_r_1.pitch = 3
24
+
25
+	self.walk_grunt = sounds('walk_grunt')
26
+	self.walk_land = sounds('walk_land')
27
+	self.walk_hang = sounds('walk_hang')
28
+	self.walk_climb = sounds('walk_climb')
13
 	self.revert = sounds('revert')
29
 	self.revert = sounds('revert')
14
 	self.engine_idle = sounds('engine_idle')
30
 	self.engine_idle = sounds('engine_idle')
15
 	self.roll.loop = True
31
 	self.roll.loop = True
86
 			c.handle_buffered.stop()
102
 			c.handle_buffered.stop()
87
 
103
 
88
 	def Record(self):
104
 	def Record(self):
105
+		
106
+
107
+		self.history.append(self.h_queue)
89
 		self.history.append(self.h_queue)
108
 		self.history.append(self.h_queue)
90
 		#self.history.insert(0, self.h_queue)
109
 		#self.history.insert(0, self.h_queue)
91
-		
92
-		#print(self.h_queue, 'appended to history')
110
+		l = len(self.history)
111
+		#print(self.h_queue, 'appended to history', l)
93
 		#self.history.append(self.h_queue)
112
 		#self.history.append(self.h_queue)
94
 		#print('appending', self.h_queue)
113
 		#print('appending', self.h_queue)
95
 		l = len(self.history)
114
 		l = len(self.history)
96
 		if l > ((self.gd['replay_record_length'])):
115
 		if l > ((self.gd['replay_record_length'])):
97
-
116
+			#del self.history[0:1]
117
+			self.history.pop(0)
98
 			self.history.pop(0)
118
 			self.history.pop(0)
99
 			#self.history.pop(self.gd['replay_record_length'])
119
 			#self.history.pop(self.gd['replay_record_length'])
100
 			#self.history.pop(0)
120
 			#self.history.pop(0)
109
 			#print(self.history[frame], self.queue, frame, 'replay queue')
129
 			#print(self.history[frame], self.queue, frame, 'replay queue')
110
 		except:
130
 		except:
111
 			print('replay audio not playing', frame, len(self.history))
131
 			print('replay audio not playing', frame, len(self.history))
112
-		#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))
113
 		if self.h_queue is not []:
134
 		if self.h_queue is not []:
114
 			for ev in self.h_queue:
135
 			for ev in self.h_queue:
115
 				result = getattr(self, ev[0])
136
 				result = getattr(self, ev[0])
116
 				#print('ev0', ev[0])
137
 				#print('ev0', ev[0])
117
 				if result.loop:
138
 				if result.loop:
118
-					#result.loop_play(ev[1], ev[2], ev[3], ev[4])
119
-					pass
139
+					result.loop_play(ev[1], ev[2], ev[3], ev[4])
140
+					#pass
120
 				else:
141
 				else:
121
 					result.play(ev[1], ev[2])
142
 					result.play(ev[1], ev[2])
122
 					#print('... playing', result.name, frame, len(self.history))
143
 					#print('... playing', result.name, frame, len(self.history))
207
 		#own['sndmgr'].Record()
228
 		#own['sndmgr'].Record()
208
 	if not dict['playback']:
229
 	if not dict['playback']:
209
 		own['sndmgr'].update()
230
 		own['sndmgr'].update()
231
+		#print('updating sound manager', dict['game_life'])
210
 
232
 
211
 	#if dict['playback']:
233
 	#if dict['playback']:
212
 		#own['sndmgr'].Playback()	
234
 		#own['sndmgr'].Playback()	

+ 961
- 1220
scripts/walk.py View File

8
 import math
8
 import math
9
 
9
 
10
 def main(cont):
10
 def main(cont):
11
-    
12
-    scene = bge.logic.getCurrentScene()
13
-    objList = scene.objects
14
-    cont = GameLogic.getCurrentController() 
15
-    obj = bge.logic.getCurrentScene().objects
16
-    char = bge.constraints.getCharacter
17
-    own = cont.owner
18
-    stance = own['stance']
19
-    STANCE = own['stance']
20
-    r_ground = cont.sensors["r_Ground"]
21
-    linvel = own.getLinearVelocity(True)
22
-    lasta = own['lasta']
23
-    lastx = own['lastx']
24
-    last_sit = own['sit']
25
-    dict = bge.logic.globalDict
11
+    pass    
12
+
13
+#---------------------------------------------------
14
+
15
+
16
+
17
+    # scene = bge.logic.getCurrentScene()
18
+    # objList = scene.objects
19
+    # cont = GameLogic.getCurrentController() 
20
+    # obj = bge.logic.getCurrentScene().objects
21
+    # char = bge.constraints.getCharacter
22
+    # own = cont.owner
23
+    # stance = own['stance']
24
+    # STANCE = own['stance']
25
+    # r_ground = cont.sensors["r_Ground"]
26
+    # linvel = own.getLinearVelocity(True)
27
+    # lasta = own['lasta']
28
+    # lastx = own['lastx']
29
+    # last_sit = own['sit']
30
+    # dict = bge.logic.globalDict
26
 
31
 
27
-    try:
28
-        own['walk_timer'] = own['walk_timer'] +1
29
-    except:
30
-        own['walk_timer'] = 1
31
-        own['walk_targ_speed'] = 2.0
32
+    # try:
33
+    #     own['walk_timer'] = own['walk_timer'] +1
34
+    # except:
35
+    #     own['walk_timer'] = 1
36
+    #     own['walk_targ_speed'] = 2.0
32
 
37
 
33
-    truckon = 450
34
-    deckon = 460
38
+    # truckon = 450
39
+    # deckon = 460
35
 
40
 
36
-    lLR = dict['lLR']
37
-    lUD = dict['lUD']
38
-    rLR = dict['rLR']
39
-    rUD = dict['rUD']
40
-    lTrig = dict['lTrig']
41
-    rTrig = dict['rTrig']
42
-    aBut = dict['aBut']
43
-    bBut = dict['bBut']
44
-    xBut = dict['xBut']
45
-    yBut = dict['yBut']
46
-    lBump = dict['lBump']
47
-    rBump = dict['rBump']
48
-    bkBut = dict['bkBut']
49
-    stBut = dict['stBut']
50
-    xbBut = dict['xbBut']
51
-    ltsBut = dict['ltsBut']
52
-    rtsBut = dict['rtsBut']
53
-    ldPad = dict['ldPad']
54
-    rdPad = dict['rdPad']
55
-    udPad = dict['udPad']
56
-    ddPad = dict['ddPad']
41
+    # lLR = dict['lLR']
42
+    # lUD = dict['lUD']
43
+    # rLR = dict['rLR']
44
+    # rUD = dict['rUD']
45
+    # lTrig = dict['lTrig']
46
+    # rTrig = dict['rTrig']
47
+    # aBut = dict['aBut']
48
+    # bBut = dict['bBut']
49
+    # xBut = dict['xBut']
50
+    # yBut = dict['yBut']
51
+    # lBump = dict['lBump']
52
+    # rBump = dict['rBump']
53
+    # bkBut = dict['bkBut']
54
+    # stBut = dict['stBut']
55
+    # xbBut = dict['xbBut']
56
+    # ltsBut = dict['ltsBut']
57
+    # rtsBut = dict['rtsBut']
58
+    # ldPad = dict['ldPad']
59
+    # rdPad = dict['rdPad']
60
+    # udPad = dict['udPad']
61
+    # ddPad = dict['ddPad']
57
 
62
 
58
-    #user
59
-    sens = .04
60
-    fliplay = 30
61
-    dropinCol = own.sensors['dropinCol']
62
-    cube = scene.objects['control_cube.002']
63
-    skater = scene.objects["Char4"]
64
-    deck = scene.objects["b_deck"]
65
-    trucks = scene.objects["b_trucks"]
66
-    camobj2 = scene.objects['camobj']
67
-    throw_deck_empty = scene.objects["throw_deck_empty"]
68
-    wheel1 = scene.objects["wheel1"]
69
-    wheel2 = scene.objects["wheel2"]
70
-    wheel3 = scene.objects["wheel3"]
71
-    wheel4 = scene.objects["wheel4"]
72
-    camobj = scene.objects["Camera.003"]
73
-    camera = cont.actuators["Camera"]
74
-    replayCam = cont.actuators["replayCam"]
75
-    timer = own['dropinTimer']
76
-    cam = scene.objects["Camera.003"]
77
-    freecam = scene.objects["freecam"]
78
-    followcam = scene.objects["followcam"]
63
+    # #user
64
+    # sens = .04
65
+    # fliplay = 30
66
+    # dropinCol = own.sensors['dropinCol']
67
+    # cube = scene.objects['control_cube.002']
68
+    # skater = scene.objects["Char4"]
69
+    # deck = scene.objects["b_deck"]
70
+    # trucks = scene.objects["b_trucks"]
71
+    # camobj2 = scene.objects['camobj']
72
+    # throw_deck_empty = scene.objects["throw_deck_empty"]
73
+    # wheel1 = scene.objects["wheel1"]
74
+    # wheel2 = scene.objects["wheel2"]
75
+    # wheel3 = scene.objects["wheel3"]
76
+    # wheel4 = scene.objects["wheel4"]
77
+    # camobj = scene.objects["Camera.003"]
78
+    # camera = cont.actuators["Camera"]
79
+    # replayCam = cont.actuators["replayCam"]
80
+    # timer = own['dropinTimer']
81
+    # cam = scene.objects["Camera.003"]
82
+    # freecam = scene.objects["freecam"]
83
+    # followcam = scene.objects["followcam"]
79
 
84
 
80
-    control_bottom = scene.objects['control_bottom']
81
-    cb = control_bottom.sensors['grindCol_bottom']
82
-    cb_td = control_bottom.sensors['td_bottom']
85
+    # control_bottom = scene.objects['control_bottom']
86
+    # cb = control_bottom.sensors['grindCol_bottom']
87
+    # cb_td = control_bottom.sensors['td_bottom']
83
 
88
 
84
-    noidle = 0
89
+    # noidle = 0
85
 
90
 
86
-    #if skater.isPlayingAction(460):  
87
-    #    noidle = 1  
91
+    # #if skater.isPlayingAction(460):  
92
+    # #    noidle = 1  
88
 
93
 
89
 
94
 
90
-    try:
91
-        walk_inc = own['walk_inc'] 
92
-    except:
93
-        own['walk_inc'] = .01
94
-        walk_inc = own['walk_inc']  
95
-        own['walk_jump_timer'] = 0   
96
-    if own['stair_counter'] != 0:
97
-        walk_inc = own['walk_inc']  *10
95
+    # try:
96
+    #     walk_inc = own['walk_inc'] 
97
+    # except:
98
+    #     own['walk_inc'] = .01
99
+    #     walk_inc = own['walk_inc']  
100
+    #     own['walk_jump_timer'] = 0   
101
+    # if own['stair_counter'] != 0:
102
+    #     walk_inc = own['walk_inc']  *10
98
 
103
 
99
-    if own["stance"] == None:
100
-        own["stance"] = True
101
-    STANCE = own["stance"]
102
-    def killact(layer):
103
-        if skater.isPlayingAction(layer):
104
-            skater.stopAction(layer)
105
-        if deck.isPlayingAction(layer):    
106
-            deck.stopAction(layer)
107
-        if trucks.isPlayingAction(layer):    
108
-            trucks.stopAction(layer)
109
-    def killall():
110
-        for x in range(5000):
111
-            skater.stopAction(x)
112
-            deck.stopAction(x)
113
-            trucks.stopAction(x)
114
-    def trucksisplaying():
115
-        for x in range(5000):
116
-            if deck.isPlayingAction(x):
117
-                print("deck is playing:", x)
104
+    # if own["stance"] == None:
105
+    #     own["stance"] = True
106
+    # STANCE = own["stance"]
107
+    # def killact(layer):
108
+    #     if skater.isPlayingAction(layer):
109
+    #         skater.stopAction(layer)
110
+    #     if deck.isPlayingAction(layer):    
111
+    #         deck.stopAction(layer)
112
+    #     if trucks.isPlayingAction(layer):    
113
+    #         trucks.stopAction(layer)
114
+    # def killall():
115
+    #     for x in range(5000):
116
+    #         skater.stopAction(x)
117
+    #         deck.stopAction(x)
118
+    #         trucks.stopAction(x)
119
+    # def trucksisplaying():
120
+    #     for x in range(5000):
121
+    #         if deck.isPlayingAction(x):
122
+    #             print("deck is playing:", x)
118
 
123
 
119
-    def printplaying():
120
-        splaying_layers = "S: "
121
-        playing_layers = "D: "
122
-        tplaying_layers = "T: "
123
-        for x in range(9900):
124
-            if skater.isPlayingAction(x):
125
-            #if trucks.isPlayingAction(x):
126
-            #if skater.isPlayingAction(x):                        
127
-                splaying_layers += str(x)
128
-                splaying_layers += " "        
129
-            if deck.isPlayingAction(x):
130
-            #if trucks.isPlayingAction(x):
131
-            #if skater.isPlayingAction(x):                        
132
-                playing_layers += str(x)
133
-                playing_layers += " "
134
-            if trucks.isPlayingAction(x):
135
-            #if trucks.isPlayingAction(x):
136
-            #if skater.isPlayingAction(x):                        
137
-                tplaying_layers += str(x)
138
-                tplaying_layers += " "            
139
-        print(splaying_layers, playing_layers, tplaying_layers) 
140
-    #printplaying() 
141
-    ##
142
-    if r_ground.positive and xBut == False and lastx == False:
143
-        killact(10)
144
-        #killact(11)
145
-        killact(12)
146
-        killact(13)              
147
-    ######################################    
124
+    # def printplaying():
125
+    #     splaying_layers = "S: "
126
+    #     playing_layers = "D: "
127
+    #     tplaying_layers = "T: "
128
+    #     for x in range(9900):
129
+    #         if skater.isPlayingAction(x):
130
+    #         #if trucks.isPlayingAction(x):
131
+    #         #if skater.isPlayingAction(x):                        
132
+    #             splaying_layers += str(x)
133
+    #             splaying_layers += " "        
134
+    #         if deck.isPlayingAction(x):
135
+    #         #if trucks.isPlayingAction(x):
136
+    #         #if skater.isPlayingAction(x):                        
137
+    #             playing_layers += str(x)
138
+    #             playing_layers += " "
139
+    #         if trucks.isPlayingAction(x):
140
+    #         #if trucks.isPlayingAction(x):
141
+    #         #if skater.isPlayingAction(x):                        
142
+    #             tplaying_layers += str(x)
143
+    #             tplaying_layers += " "            
144
+    #     print(splaying_layers, playing_layers, tplaying_layers) 
145
+    # #printplaying() 
146
+    # ##
147
+    # if r_ground.positive and xBut == False and lastx == False:
148
+    #     killact(10)
149
+    #     #killact(11)
150
+    #     killact(12)
151
+    #     killact(13)              
152
+    # ######################################    
148
 
153
 
149
-    #idle      
150
-    if stance == 0 and skater.isPlayingAction(fliplay) == False and yBut == False and r_ground.triggered and xBut == False and noidle == 0 and own['walk_idling'] == 0 and own['sit'] == 0 and own['dropinTimer'] == 0 and own['lasty']  == False:
151
-        own['requestAction'] = 'reg_idle'
152
-        if own['throw_deck'] == True:
153
-            own['requestAction'] = 'reg_idle_nb'
154
+    # #idle      
155
+    # #if stance == 0 and skater.isPlayingAction(fliplay) == False and yBut == False and r_ground.triggered and xBut == False and noidle == 0 and own['walk_idling'] == 0 and own['sit'] == 0 and own['dropinTimer'] == 0 and own['lasty']  == False:
156
+    #     #own['requestAction'] = 'reg_idle'
157
+    #     #if own['throw_deck'] == True:
158
+    #         #own['requestAction'] = 'reg_idle_nb'
154
 
159
 
155
-    if stance == 1 and skater.isPlayingAction(fliplay) == False and yBut == False and r_ground.triggered and xBut == False and noidle == 0 and own['walk_idling'] == 0 and own['sit'] == 0 and own['dropinTimer'] == 0 and own['lasty']  == False:
156
-        own['requestAction'] = 'fak_idle'
157
-        if own['throw_deck'] == True:
158
-            own['requestAction'] = 'fak_idle_nb'
160
+    # #if stance == 1 and skater.isPlayingAction(fliplay) == False and yBut == False and r_ground.triggered and xBut == False and noidle == 0 and own['walk_idling'] == 0 and own['sit'] == 0 and own['dropinTimer'] == 0 and own['lasty']  == False:
161
+    #     #own['requestAction'] = 'fak_idle'
162
+    #     #if own['throw_deck'] == True:
163
+    #         #own['requestAction'] = 'fak_idle_nb'
159
 
164
 
160
-    if lUD < -sens:
161
-        lup = 1
162
-    else:
163
-        lup = 0
164
-    if lUD > sens:
165
-        ldown = 1
166
-    else:
167
-        ldown = 0 
168
-    if lLR < -sens:
169
-        lLeft = 1
170
-    else:
171
-        lLeft = 0
172
-    if lLR > sens:
173
-        lRight = 1
174
-    else:
175
-        lRight = 0        
165
+    # if lUD < -sens:
166
+    #     lup = 1
167
+    # else:
168
+    #     lup = 0
169
+    # if lUD > sens:
170
+    #     ldown = 1
171
+    # else:
172
+    #     ldown = 0 
173
+    # if lLR < -sens:
174
+    #     lLeft = 1
175
+    # else:
176
+    #     lLeft = 0
177
+    # if lLR > sens:
178
+    #     lRight = 1
179
+    # else:
180
+    #     lRight = 0        
176
 
181
 
177
 
182
 
178
 
183
 
179
-    #turning
180
-    walk_turn_amt = .005#.05
181
-    turning = False
182
-    if r_ground.positive:
183
-        num = .4#.5
184
-        tilt = .015
185
-        if STANCE == 1:
186
-            num *= -1
187
-            tilt *= -1
188
-        if lRight == 1 or dict['kb_ra'] == 2:
189
-            #cont.activate(own.actuators['right'])
190
-            own.linearVelocity.y = num
191
-            if own['stair_counter'] > 0:
192
-                if STANCE == 0:
193
-                    own.applyRotation([0,0,walk_turn_amt], True)
194
-                else:
195
-                    own.applyRotation([0,0,-walk_turn_amt], True)                
196
-            else:
197
-                own.applyRotation([-tilt, 0, 0], True)
198
-            turning = True
199
-        else:
200
-            #cont.deactivate(own.actuators['right']) 
201
-            pass  
184
+    # #turning
185
+    # walk_turn_amt = .005#.05
186
+    # turning = False
187
+    # if r_ground.positive:
188
+    #     num = .4#.5
189
+    #     tilt = .015
190
+    #     if STANCE == 1:
191
+    #         num *= -1
192
+    #         tilt *= -1
193
+    #     if lRight == 1 or dict['kb_ra'] == 2:
194
+    #         #cont.activate(own.actuators['right'])
195
+    #         own.linearVelocity.y = num
196
+    #         if own['stair_counter'] > 0:
197
+    #             if STANCE == 0:
198
+    #                 own.applyRotation([0,0,walk_turn_amt], True)
199
+    #             else:
200
+    #                 own.applyRotation([0,0,-walk_turn_amt], True)                
201
+    #         else:
202
+    #             own.applyRotation([-tilt, 0, 0], True)
203
+    #         turning = True
204
+    #     else:
205
+    #         #cont.deactivate(own.actuators['right']) 
206
+    #         pass  
202
             
207
             
203
-        if lLeft == 1 or dict['kb_la'] == 2:
204
-            #cont.activate(own.actuators['left']) 
205
-            own.linearVelocity.y = -num
206
-            if own['stair_counter'] > 0:
207
-                if STANCE == 0:
208
-                    own.applyRotation([0,0,walk_turn_amt], True)
209
-                else:
210
-                    own.applyRotation([0,0,-walk_turn_amt], True)                                
211
-            else:        
212
-                own.applyRotation([tilt, 0, 0], True)        
213
-            turning = True
214
-        else:
215
-            #cont.deactivate(own.actuators['left'])        
216
-            pass
208
+    #     if lLeft == 1 or dict['kb_la'] == 2:
209
+    #         #cont.activate(own.actuators['left']) 
210
+    #         own.linearVelocity.y = -num
211
+    #         if own['stair_counter'] > 0:
212
+    #             if STANCE == 0:
213
+    #                 own.applyRotation([0,0,walk_turn_amt], True)
214
+    #             else:
215
+    #                 own.applyRotation([0,0,-walk_turn_amt], True)                                
216
+    #         else:        
217
+    #             own.applyRotation([tilt, 0, 0], True)        
218
+    #         turning = True
219
+    #     else:
220
+    #         #cont.deactivate(own.actuators['left'])        
221
+    #         pass
217
 
222
 
218
-    #in air        
219
-    #if (lup == 1 or dict['kb_ua'] != 0) and r_ground.positive == False:
220
-    if r_ground.positive == False:
221
-        airrot = .05
222
-        if lLeft == 1 or dict['kb_la'] == 2:
223
-            if stance == 0:
224
-                own.applyRotation([0,0,airrot], True)
225
-            if stance == 1:    
226
-                own.applyRotation([0,0,airrot], True)
227
-        if lRight == 1 or dict['kb_ra'] == 2:
228
-            if stance == 0:
229
-                own.applyRotation([0,0,-airrot], True)
230
-            if stance == 1:    
231
-                own.applyRotation([0,0,-airrot], True)  
223
+    # #in air        
224
+    # #if (lup == 1 or dict['kb_ua'] != 0) and r_ground.positive == False:
225
+    # if r_ground.positive == False:
226
+    #     airrot = .05
227
+    #     if lLeft == 1 or dict['kb_la'] == 2:
228
+    #         if stance == 0:
229
+    #             own.applyRotation([0,0,airrot], True)
230
+    #         if stance == 1:    
231
+    #             own.applyRotation([0,0,airrot], True)
232
+    #     if lRight == 1 or dict['kb_ra'] == 2:
233
+    #         if stance == 0:
234
+    #             own.applyRotation([0,0,-airrot], True)
235
+    #         if stance == 1:    
236
+    #             own.applyRotation([0,0,-airrot], True)  
232
                 
237
                 
233
-        if lup == 1 or dict['kb_ua'] == 2:
234
-            if own.linearVelocity.x < 10 and own .linearVelocity.x > - 10:
235
-                if stance == 0:
236
-                    own.linearVelocity.x -= .04
237
-                if stance == 1:
238
-                    own.linearVelocity.x += .04                             
239
-        own['lF_air_frame'] = own['framenum']  
240
-        own.actuators["walkondirt"].stopSound()
238
+    #     if lup == 1 or dict['kb_ua'] == 2:
239
+    #         if own.linearVelocity.x < 10 and own .linearVelocity.x > - 10:
240
+    #             if stance == 0:
241
+    #                 own.linearVelocity.x -= .04
242
+    #             if stance == 1:
243
+    #                 own.linearVelocity.x += .04                             
244
+    #     own['lF_air_frame'] = own['framenum']  
245
+    #     own.actuators["walkondirt"].stopSound()
241
 
246
 
242
         
247
         
243
-    #walking
248
+    # #walking
244
 
249
 
245
-    #new walking
246
-    vel = own.getLinearVelocity(True)
247
-    if own['walk_timer'] < 50:
248
-        velx = vel.x * .95             
249
-        own.setLinearVelocity([velx, 0, vel.z], True)
250
-        #print('y is zero')
251
-    else:
252
-        pass
253
-        #own.setLinearVelocity([0, 0, vel.z], True)
250
+    # #new walking
251
+    # vel = own.getLinearVelocity(True)
252
+    # if own['walk_timer'] < 50:
253
+    #     velx = vel.x * .95             
254
+    #     own.setLinearVelocity([velx, 0, vel.z], True)
255
+    #     #print('y is zero')
256
+    # else:
257
+    #     pass
258
+    #     #own.setLinearVelocity([0, 0, vel.z], True)
254
         
259
         
255
-    wf = 1
256
-    if own['last_walk_frame'] - own['last_roll_frame'] > 55:
257
-        wf = 0   
260
+    # wf = 1
261
+    # if own['last_walk_frame'] - own['last_roll_frame'] > 55:
262
+    #     wf = 0   
258
        
263
        
259
-    if ((lup == 1 and aBut == 0) or (dict['kb_ua'] == 2 and dict['kb_lsh'] == 0)) and (r_ground.positive or own['stair_counter'] > 0) and xBut == 0 and wf == 0 and dict['kb_space'] == 0:
260
-        own['walking'] = "regular"
261
-        walking = "regular"
264
+    # if ((lup == 1 and aBut == 0) or (dict['kb_ua'] == 2 and dict['kb_lsh'] == 0)) and (r_ground.positive or own['stair_counter'] > 0) and xBut == 0 and wf == 0 and dict['kb_space'] == 0:
265
+    #     own['walking'] = "regular"
266
+    #     walking = "regular"
262
         
267
         
263
-    elif ((lup == 1 and aBut == 1) or (dict['kb_lsh'] == 2 and dict['kb_ua'] == 2)) and yBut == False and (r_ground.positive or own['stair_counter'] > 0) and xBut == 0 and wf == 0 and dict['kb_space'] != 2:
264
-        own['walking'] = "fast"
265
-        walking = "fast"
266
-    else:
267
-        own['walking'] = None
268
-        walking = None
268
+    # elif ((lup == 1 and aBut == 1) or (dict['kb_lsh'] == 2 and dict['kb_ua'] == 2)) and yBut == False and (r_ground.positive or own['stair_counter'] > 0) and xBut == 0 and wf == 0 and dict['kb_space'] != 2:
269
+    #     own['walking'] = "fast"
270
+    #     walking = "fast"
271
+    # else:
272
+    #     own['walking'] = None
273
+    #     walking = None
269
        
274
        
270
-    if walking == "regular":  
271
-        if stance == 1:
272
-            if linvel.x < own['walk_targ_speed']:
273
-                own.linearVelocity.x = linvel.x + walk_inc
274
-            else:
275
-                own.linearVelocity.x = own['walk_targ_speed']    
276
-        else:
277
-            if linvel.x > -own['walk_targ_speed']:
278
-                own.linearVelocity.x = linvel.x - walk_inc       
279
-            else:
280
-                own.linearVelocity.x = -own['walk_targ_speed']                
281
-    if walking == "fast":   
282
-        if stance == 1:
283
-            if linvel.x < own['walk_fast_targ_speed']:
284
-                own.linearVelocity.x = linvel.x + walk_inc
285
-            else:
286
-                own.linearVelocity.x = own['walk_fast_targ_speed']  
287
-        else:
288
-            if linvel.x > -own['walk_fast_targ_speed']:
289
-                own.linearVelocity.x = linvel.x - walk_inc      
290
-            else:
291
-                own.linearVelocity.x = -own['walk_fast_targ_speed'] 
275
+    # if walking == "regular":  
276
+    #     if stance == 1:
277
+    #         if linvel.x < own['walk_targ_speed']:
278
+    #             own.linearVelocity.x = linvel.x + walk_inc
279
+    #         else:
280
+    #             own.linearVelocity.x = own['walk_targ_speed']    
281
+    #     else:
282
+    #         if linvel.x > -own['walk_targ_speed']:
283
+    #             own.linearVelocity.x = linvel.x - walk_inc       
284
+    #         else:
285
+    #             own.linearVelocity.x = -own['walk_targ_speed']                
286
+    # if walking == "fast":   
287
+    #     if stance == 1:
288
+    #         if linvel.x < own['walk_fast_targ_speed']:
289
+    #             own.linearVelocity.x = linvel.x + walk_inc
290
+    #         else:
291
+    #             own.linearVelocity.x = own['walk_fast_targ_speed']  
292
+    #     else:
293
+    #         if linvel.x > -own['walk_fast_targ_speed']:
294
+    #             own.linearVelocity.x = linvel.x - walk_inc      
295
+    #         else:
296
+    #             own.linearVelocity.x = -own['walk_fast_targ_speed'] 
292
 
297
 
293
-    if walking == None and r_ground.positive and own['walk_jump_timer'] == 0:      
294
-        if own['walk_timer'] < 50 and turning == False:
295
-            velx = vel.x * .95             
296
-            own.setLinearVelocity([velx, 0, vel.z], True)
297
-        elif own['walk_timer'] > 50:
298
-            if own.linearVelocity.x > .1 or own.linearVelocity.x < -.1:
299
-                own.linearVelocity.x *= .01
300
-            else:
301
-                own.linearVelocity.x = 0
302
-            if turning == False:    
303
-                if own.linearVelocity.y > .01 or own.linearVelocity.y < -.01:
304
-                    own.linearVelocity.y *= .01
305
-                else:
306
-                    own.linearVelocity.y = 0                
307
-            #own.setLinearVelocity([0, 0, vel.z], True) 
298
+    # if walking == None and r_ground.positive and own['walk_jump_timer'] == 0:      
299
+    #     if own['walk_timer'] < 50 and turning == False:
300
+    #         velx = vel.x * .95             
301
+    #         own.setLinearVelocity([velx, 0, vel.z], True)
302
+    #     elif own['walk_timer'] > 50:
303
+    #         if own.linearVelocity.x > .1 or own.linearVelocity.x < -.1:
304
+    #             own.linearVelocity.x *= .01
305
+    #         else:
306
+    #             own.linearVelocity.x = 0
307
+    #         if turning == False:    
308
+    #             if own.linearVelocity.y > .01 or own.linearVelocity.y < -.01:
309
+    #                 own.linearVelocity.y *= .01
310
+    #             else:
311
+    #                 own.linearVelocity.y = 0                
312
+    #         #own.setLinearVelocity([0, 0, vel.z], True) 
308
         
313
         
309
-    #old walking
310
-    if ((lup == 1 and aBut == 0) or (dict['kb_ua'] == 2 and dict['kb_lsh'] == 0)  and yBut == False and (r_ground.positive or own['stair_counter'] > 0) and xBut == 0) or (turning == True and aBut == 0):
311
-        own.actuators["walkondirt"].volume = .2
312
-        own.actuators["walkondirt"].pitch = 1
313
-        cont.activate(own.actuators["walkondirt"])          
314
-        if stance == 0 and skater.isPlayingAction(fliplay) == False:             
315
-            #without deck
316
-            if own['throw_deck'] == True:
317
-                own['requestAction'] = 'reg_walk_nb'
318
-            else:
319
-                own['requestAction'] = 'reg_walk'
314
+    # #old walking
315
+    # if ((lup == 1 and aBut == 0) or (dict['kb_ua'] == 2 and dict['kb_lsh'] == 0)  and yBut == False and (r_ground.positive or own['stair_counter'] > 0) and xBut == 0) or (turning == True and aBut == 0):
316
+    #     own.actuators["walkondirt"].volume = .2
317
+    #     own.actuators["walkondirt"].pitch = 1
318
+    #     cont.activate(own.actuators["walkondirt"])          
319
+    #     if stance == 0 and skater.isPlayingAction(fliplay) == False:             
320
+    #         #without deck
321
+    #         if own['throw_deck'] == True:
322
+    #             own['requestAction'] = 'reg_walk_nb'
323
+    #         else:
324
+    #             own['requestAction'] = 'reg_walk'
320
                    
325
                    
321
-        if stance == 1 and skater.isPlayingAction(fliplay) == False:        
322
-            #without deck
323
-            if own['throw_deck'] == True:
324
-                own['requestAction'] = 'fak_walk_nb'
325
-            else:
326
-                own['requestAction'] = 'fak_walk'
326
+    #     if stance == 1 and skater.isPlayingAction(fliplay) == False:        
327
+    #         #without deck
328
+    #         if own['throw_deck'] == True:
329
+    #             own['requestAction'] = 'fak_walk_nb'
330
+    #         else:
331
+    #             own['requestAction'] = 'fak_walk'
327
            
332
            
328
-    elif (((lup == 1 and aBut == 1) or (dict['kb_lsh'] == 2 and dict['kb_ua'] == 2)) and yBut == False and (r_ground.positive or own['stair_counter'] > 0) and xBut == 0) or (turning == True and aBut == 1):
329
-        own.actuators["walkondirt"].volume = .2
330
-        #own.actuators["walkondirt"].pitch = 1.3
331
-        own.actuators["walkondirt"].pitch = 2
332
-        cont.activate(own.actuators["walkondirt"])
333
-        #print('fastwalk')
334
-        if stance == 0 and skater.isPlayingAction(fliplay) == False:        
335
-            if own['throw_deck'] == True:
336
-                own['requestAction'] = 'reg_walkFast_nb'
337
-            else:
338
-                own['requestAction'] = 'reg_walkFast'
333
+    # elif (((lup == 1 and aBut == 1) or (dict['kb_lsh'] == 2 and dict['kb_ua'] == 2)) and yBut == False and (r_ground.positive or own['stair_counter'] > 0) and xBut == 0) or (turning == True and aBut == 1):
334
+    #     own.actuators["walkondirt"].volume = .2
335
+    #     #own.actuators["walkondirt"].pitch = 1.3
336
+    #     own.actuators["walkondirt"].pitch = 2
337
+    #     cont.activate(own.actuators["walkondirt"])
338
+    #     #print('fastwalk')
339
+    #     if stance == 0 and skater.isPlayingAction(fliplay) == False:        
340
+    #         if own['throw_deck'] == True:
341
+    #             own['requestAction'] = 'reg_walkFast_nb'
342
+    #         else:
343
+    #             own['requestAction'] = 'reg_walkFast'
339
              
344
              
340
-        if stance == 1 and skater.isPlayingAction(fliplay) == False:        
341
-            if own['throw_deck'] == True:
342
-                own['requestAction'] = 'fak_walkFast_nb'          
343
-            else:
344
-                own['requestAction'] = 'fak_walkFast'             
345
-    else:
346
-        vel = own.getLinearVelocity(True)
347
-        cont.deactivate(own.actuators["walkondirt"])       
345
+    #     if stance == 1 and skater.isPlayingAction(fliplay) == False:        
346
+    #         if own['throw_deck'] == True:
347
+    #             own['requestAction'] = 'fak_walkFast_nb'          
348
+    #         else:
349
+    #             own['requestAction'] = 'fak_walkFast'             
350
+    # else:
351
+    #     vel = own.getLinearVelocity(True)
352
+    #     cont.deactivate(own.actuators["walkondirt"])       
348
 
353
 
349
            
354
            
350
-    #---------------
351
-    if rLR > .05:
352
-        cont.activate(camobj.actuators['camRight'])
353
-    else:
354
-        cont.deactivate(camobj.actuators['camRight'])    
355
-    if rLR < -.05:
356
-        cont.activate(camobj.actuators['camLeft'])
357
-    else:
358
-        cont.deactivate(camobj.actuators['camLeft'])     
359
-    if rUD > .05:
360
-        cont.activate(camobj.actuators['camDown'])
361
-    else:
362
-        cont.deactivate(camobj.actuators['camDown'])     
363
-    if rUD < -.05:
364
-        cont.activate(camobj.actuators['camUp'])
365
-    else:
366
-        cont.deactivate(camobj.actuators['camUp'])     
355
+    # #---------------
356
+    # if rLR > .05:
357
+    #     cont.activate(camobj.actuators['camRight'])
358
+    # else:
359
+    #     cont.deactivate(camobj.actuators['camRight'])    
360
+    # if rLR < -.05:
361
+    #     cont.activate(camobj.actuators['camLeft'])
362
+    # else:
363
+    #     cont.deactivate(camobj.actuators['camLeft'])     
364
+    # if rUD > .05:
365
+    #     cont.activate(camobj.actuators['camDown'])
366
+    # else:
367
+    #     cont.deactivate(camobj.actuators['camDown'])     
368
+    # if rUD < -.05:
369
+    #     cont.activate(camobj.actuators['camUp'])
370
+    # else:
371
+    #     cont.deactivate(camobj.actuators['camUp'])     
367
                     
372
                     
368
-    #----------------
369
-    #camera.height = .01 #.9
370
-    #camera.min = 1.75
371
-    #camera.max = 2.25
372
-    lasty = own['lasty']     
373
+    # #----------------
374
+    # #camera.height = .01 #.9
375
+    # #camera.min = 1.75
376
+    # #camera.max = 2.25
377
+    # lasty = own['lasty']     
373
 
378
 
374
-    def onboard():
375
-        if own['walk'] == 0:
376
-            print("start walking")
377
-            own['walk_idling'] = 0
378
-            if own['framenum'] > 100 and own['fall'] == False:
379
-                #cont.activate(own.actuators['pop'])
380
-                camobj['sndmgr'].queue_sound(['pop', cube, camobj])
381
-            own['getoffboard'] = False
382
-            own["walk_idle_frame"] = own["framenum"]
383
-            own['grindcement_vol'] = 0
384
-            own['grindcement_pitch'] = 0
385
-            own['grindrail_vol'] = 0
386
-            own['grindrail_pitch'] = 0 
387
-            own['sroll_vol'] = 0
388
-            own['sroll_pitch'] = 0 
379
+    # def onboard():
380
+    #     if own['walk'] == 0:
381
+    #         print("start walking")
382
+    #         own['walk_idling'] = 0
383
+    #         if own['framenum'] > 100 and own['fall'] == False:
384
+    #             #cont.activate(own.actuators['pop'])
385
+    #             camobj['sndmgr'].queue_sound(['pop', cube, camobj])
386
+    #         own['getoffboard'] = False
387
+    #         own["walk_idle_frame"] = own["framenum"]
388
+    #         own['grindcement_vol'] = 0
389
+    #         own['grindcement_pitch'] = 0
390
+    #         own['grindrail_vol'] = 0
391
+    #         own['grindrail_pitch'] = 0 
392
+    #         own['sroll_vol'] = 0
393
+    #         own['sroll_pitch'] = 0 
389
 
394
 
390
             
395
             
391
-            #camobj.worldPosition.z += 4              
392
-            try:
393
-                vel = own['offboard_vel']
394
-                vel = [velx, vel.y, vel.z]           
395
-            except: 
396
-                pass
396
+    #         #camobj.worldPosition.z += 4              
397
+    #         try:
398
+    #             vel = own['offboard_vel']
399
+    #             vel = [velx, vel.y, vel.z]           
400
+    #         except: 
401
+    #             pass
397
              
402
              
398
-            if STANCE == 0:
399
-                own['requestAction'] = 'reg_offboard'             
400
-                print('requesting off board')
403
+    #         if STANCE == 0:
404
+    #             #own['requestAction'] = 'reg_offboard'             
405
+    #             print('requesting off board')
401
                 
406
                 
402
-            if STANCE == 1:
403
-                own['requestAction'] = 'fak_offboard'                          
404
-    def jump():
405
-        #limit fall speed
406
-        if linvel.z < -10:
407
-            own.linearVelocity.z = -10
408
-        if xBut == True or dict['kb_space'] == 1: 
409
-            if own['lastx'] == 0:
410
-                #killact(3)
411
-                #killact(4)
412
-                #killact(5)
413
-                #killact(6)
414
-                #killact(7)      
415
-                if STANCE == 0:  
416
-                    own['requestAction'] ='reg_jump'  
417
-                    #print('jump') 
418
-                if STANCE == 1:
419
-                    own['requestAction'] ='fak_jump'             
420
-                    #print('jump')
421
-                JUMPHEIGHT = 1100
422
-                force = [ 0.0, 0.0, JUMPHEIGHT]
423
-                # use local axis
424
-                local = False
425
-                # apply force -- limit jump speed
426
-                if linvel.z < 10:
427
-                    #own.applyForce(force, local)
428
-                    own.linearVelocity.z += 5
429
-                    own.linearVelocity.x = linvel.x
430
-                    own.linearVelocity.y = linvel.y
431
-                    own['walk_jump_timer'] = 6
432
-            own['lastx'] = 1
433
-        else:
434
-            own['lastx'] = 0  
407
+    #         #if STANCE == 1:
408
+    #             #own['requestAction'] = 'fak_offboard'                          
409
+    # def jump():
410
+    #     pass
411
+    #     # #limit fall speed
412
+    #     # if linvel.z < -10:
413
+    #     #     own.linearVelocity.z = -10
414
+    #     # if xBut == True or dict['kb_space'] == 1: 
415
+    #     #     if own['lastx'] == 0:
416
+    #     #         #killact(3)
417
+    #     #         #killact(4)
418
+    #     #         #killact(5)
419
+    #     #         #killact(6)
420
+    #     #         #killact(7)      
421
+    #     #         if STANCE == 0:  
422
+    #     #             own['requestAction'] ='reg_jump'  
423
+    #     #             #print('jump') 
424
+    #     #         if STANCE == 1:
425
+    #     #             own['requestAction'] ='fak_jump'             
426
+    #     #             #print('jump')
427
+    #     #         JUMPHEIGHT = 1100
428
+    #     #         force = [ 0.0, 0.0, JUMPHEIGHT]
429
+    #     #         # use local axis
430
+    #     #         local = False
431
+    #     #         # apply force -- limit jump speed
432
+    #     #         if linvel.z < 10:
433
+    #     #             #own.applyForce(force, local)
434
+    #     #             own.linearVelocity.z += 5
435
+    #     #             own.linearVelocity.x = linvel.x
436
+    #     #             own.linearVelocity.y = linvel.y
437
+    #     #             own['walk_jump_timer'] = 6
438
+    #     #     own['lastx'] = 1
439
+    #     # else:
440
+    #     #     own['lastx'] = 0  
435
             
441
             
436
-    def getonboard(dict, cont):
437
-        grindDar = cont.sensors['grindDar2']
438
-        getonboard = own['getonboard']
439
-        fliplay2 = 50#8560
440
-        if ((yBut == True and dict['last_yBut'] == False) or dict['kb_q'] == 2):# and (cont.sensors["vehicleNear"].positive == False and own['throw_deck'] == False):
441
-            fliplay3 = fliplay2 + 1
442
-            dar = 0 
443
-            if grindDar.hitObjectList != None:
444
-                for x in grindDar.hitObjectList:
445
-                    to_grinder = (x.worldPosition - own.worldPosition).length
446
-                    #if 'coping' in x and to_grinder < .36:
447
-                    if 'coping' in x:    
448
-                        dar = 1
449
-            if dropinCol.positive == True or dar == 1: 
450
-                nearestObject = None
451
-                grindEmpty = scene.objects['grindEmpty']
452
-                grindDar = grindEmpty.sensors['grindDar2']
453
-                minDist = None             
454
-                if grindDar.positive:
455
-                    detectedObjects = grindDar.hitObjectList
456
-                    dist = 0
457
-                    for obj in detectedObjects:
458
-                        dist = own.getDistanceTo(obj)
459
-                        if (minDist is None or dist < minDist):
460
-                            nearestObject = obj
461
-                            minDist = dist
462
-                # if nearestObject != None:
463
-                #     #print(nearestObject)
464
-                #     obj = nearestObject
465
-                #     player_e = own.worldOrientation.to_euler()
466
-                #     player_pos = own.worldPosition
467
-                #     player_rotz = math.degrees(player_e[2])                
468
-                #     grinder_e = obj.worldOrientation.to_euler()
469
-                #     grinder_rotz = math.degrees(grinder_e[2])            
470
-                #     rot = player_rotz - grinder_rotz  
471
-                #     grinder_pos = obj.worldPosition 
472
-                #     worldVect = [1, 0, 0]
473
-                #     vect = obj.getAxisVect(worldVect)      
474
-                #     go = obj.worldOrientation
475
-                #     grinder_axis = [1,0,0] 
476
-                #     try: 
477
-                #         delta = player_pos - grinder_pos
478
-                        
479
-                #         delta = delta.cross(vect)
480
-                #         if delta[2] >= 0:
481
-                #             grindside = "right"
482
-                #         else:
483
-                #             grindside = "left"                    
484
-                #         deltamove = delta[2] * .1#.25
485
-                #         if STANCE == 0:
486
-                #             move = [-deltamove, 0, 0]
487
-                #         else:
488
-                #             move = [deltamove, 0, 0]                            
489
-                #         own.applyMovement(move, True)                    
490
-                #     except:
491
-                #         pass 
492
-                print('dropin')
493
-                if STANCE == 0: 
494
-                    own['requestAction'] ='reg_dropin' 
495
-                    own['dropinTimer'] = 60                                     
442
+    # def getonboard(dict, cont):
443
+    #     grindDar = cont.sensors['grindDar2']
444
+    #     getonboard = own['getonboard']
445
+    #     fliplay2 = 50#8560
446
+    #     if ((yBut == True and dict['last_yBut'] == False) or dict['kb_q'] == 2):# and (cont.sensors["vehicleNear"].positive == False and own['throw_deck'] == False):
447
+    #         fliplay3 = fliplay2 + 1
448
+    #         dar = 0 
449
+    #         if grindDar.hitObjectList != None:
450
+    #             for x in grindDar.hitObjectList:
451
+    #                 to_grinder = (x.worldPosition - own.worldPosition).length
452
+    #                 #if 'coping' in x and to_grinder < .36:
453
+    #                 if 'coping' in x:    
454
+    #                     dar = 1
455
+    #         if dropinCol.positive == True or dar == 1: 
456
+    #             nearestObject = None
457
+    #             grindEmpty = scene.objects['grindEmpty']
458
+    #             grindDar = grindEmpty.sensors['grindDar2']
459
+    #             minDist = None             
460
+    #             if grindDar.positive:
461
+    #                 detectedObjects = grindDar.hitObjectList
462
+    #                 dist = 0
463
+    #                 for obj in detectedObjects:
464
+    #                     dist = own.getDistanceTo(obj)
465
+    #                     if (minDist is None or dist < minDist):
466
+    #                         nearestObject = obj
467
+    #                         minDist = dist
468
+
469
+    #             print('dropin')
470
+    #             if STANCE == 0: 
471
+    #                 own['requestAction'] ='reg_dropin' 
472
+    #                 own['dropinTimer'] = 60                                     
496
                         
473
                         
497
-                if STANCE == 1: 
498
-                    own['requestAction'] ='fak_dropin'  
499
-                    own['dropinTimer'] = 60                                 
474
+    #             if STANCE == 1: 
475
+    #                 own['requestAction'] ='fak_dropin'  
476
+    #                 own['dropinTimer'] = 60                                 
500
                                          
477
                                          
501
-        if getonboard == 1:
502
-            fliplay3 = 6000 
503
-            onboard_speed = .1                                      
504
-            own['getonboard'] = 0 
505
-            own['walk_idling'] = 0
506
-        if (yBut == False and lasty == True) or (yBut == True or dict['kb_q'] == 3) and dropinCol.positive:
507
-            print('getting on board')
508
-            deckact = deck.actuators["Visibility"]
509
-            trucksact = trucks.actuators["Visibility"]
510
-            wheel1act = wheel1.actuators["Visibility"]
511
-            wheel2act = wheel2.actuators["Visibility"]
512
-            wheel3act = wheel3.actuators["Visibility"]
513
-            wheel4act = wheel4.actuators["Visibility"]        
514
-            deckact.visibility = True
515
-            trucksact.visibility = True
516
-            wheel1act.visibility = True
517
-            wheel2act.visibility = True
518
-            wheel3act.visibility = True
519
-            wheel4act.visibility = True  
520
-            cont.activate(deck.actuators['Visibility'])
521
-            cont.activate(trucks.actuators['Visibility'])
522
-            cont.activate(wheel1.actuators['Visibility'])
523
-            cont.activate(wheel2.actuators['Visibility'])
524
-            cont.activate(wheel3.actuators['Visibility'])
525
-            cont.activate(wheel4.actuators['Visibility']) 
526
-            own['throw_deck'] = False 
527
-            throw_deck_empty = scene.objects["throw_deck_empty"]
528
-            throw_deck_empty['kill_deck'] = 1 
529
-        if ((yBut == False and lasty == True) or dict['kb_q'] == 3):# and cont.sensors["vehicleNear"].positive == False: 
530
-            print('secondary get on board')              
531
-            own['getonboard'] = 1 
532
-            own['walk_idling'] = 0      
533
-            deckact = deck.actuators["Visibility"]
534
-            trucksact = trucks.actuators["Visibility"]
535
-            wheel1act = wheel1.actuators["Visibility"]
536
-            wheel2act = wheel2.actuators["Visibility"]
537
-            wheel3act = wheel3.actuators["Visibility"]
538
-            wheel4act = wheel4.actuators["Visibility"]        
539
-            deckact.visibility = True
540
-            trucksact.visibility = True
541
-            wheel1act.visibility = True
542
-            wheel2act.visibility = True
543
-            wheel3act.visibility = True
544
-            wheel4act.visibility = True  
545
-            cont.activate(deck.actuators['Visibility'])
546
-            cont.activate(trucks.actuators['Visibility'])
547
-            cont.activate(wheel1.actuators['Visibility'])
548
-            cont.activate(wheel2.actuators['Visibility'])
549
-            cont.activate(wheel3.actuators['Visibility'])
550
-            cont.activate(wheel4.actuators['Visibility']) 
551
-            own['throw_deck'] = False 
552
-            throw_deck_empty = scene.objects["throw_deck_empty"]
553
-            throw_deck_empty['kill_deck'] = 1 
478
+    #     if getonboard == 1:
479
+    #         fliplay3 = 6000 
480
+    #         onboard_speed = .1                                      
481
+    #         own['getonboard'] = 0 
482
+    #         own['walk_idling'] = 0
483
+    #     if (yBut == False and lasty == True) or (yBut == True or dict['kb_q'] == 3) and dropinCol.positive:
484
+    #         print('getting on board')
485
+    #         deckact = deck.actuators["Visibility"]
486
+    #         trucksact = trucks.actuators["Visibility"]
487
+    #         wheel1act = wheel1.actuators["Visibility"]
488
+    #         wheel2act = wheel2.actuators["Visibility"]
489
+    #         wheel3act = wheel3.actuators["Visibility"]
490
+    #         wheel4act = wheel4.actuators["Visibility"]        
491
+    #         deckact.visibility = True
492
+    #         trucksact.visibility = True
493
+    #         wheel1act.visibility = True
494
+    #         wheel2act.visibility = True
495
+    #         wheel3act.visibility = True
496
+    #         wheel4act.visibility = True  
497
+    #         cont.activate(deck.actuators['Visibility'])
498
+    #         cont.activate(trucks.actuators['Visibility'])
499
+    #         cont.activate(wheel1.actuators['Visibility'])
500
+    #         cont.activate(wheel2.actuators['Visibility'])
501
+    #         cont.activate(wheel3.actuators['Visibility'])
502
+    #         cont.activate(wheel4.actuators['Visibility']) 
503
+    #         own['throw_deck'] = False 
504
+    #         throw_deck_empty = scene.objects["throw_deck_empty"]
505
+    #         throw_deck_empty['kill_deck'] = 1 
506
+    #     if ((yBut == False and lasty == True) or dict['kb_q'] == 3):# and cont.sensors["vehicleNear"].positive == False: 
507
+    #         print('secondary get on board')              
508
+    #         own['getonboard'] = 1 
509
+    #         own['walk_idling'] = 0      
510
+    #         deckact = deck.actuators["Visibility"]
511
+    #         trucksact = trucks.actuators["Visibility"]
512
+    #         wheel1act = wheel1.actuators["Visibility"]
513
+    #         wheel2act = wheel2.actuators["Visibility"]
514
+    #         wheel3act = wheel3.actuators["Visibility"]
515
+    #         wheel4act = wheel4.actuators["Visibility"]        
516
+    #         deckact.visibility = True
517
+    #         trucksact.visibility = True
518
+    #         wheel1act.visibility = True
519
+    #         wheel2act.visibility = True
520
+    #         wheel3act.visibility = True
521
+    #         wheel4act.visibility = True  
522
+    #         cont.activate(deck.actuators['Visibility'])
523
+    #         cont.activate(trucks.actuators['Visibility'])
524
+    #         cont.activate(wheel1.actuators['Visibility'])
525
+    #         cont.activate(wheel2.actuators['Visibility'])
526
+    #         cont.activate(wheel3.actuators['Visibility'])
527
+    #         cont.activate(wheel4.actuators['Visibility']) 
528
+    #         own['throw_deck'] = False 
529
+    #         throw_deck_empty = scene.objects["throw_deck_empty"]
530
+    #         throw_deck_empty['kill_deck'] = 1 
554
 
531
 
555
 
532
 
556
 
533
 
557
-    def nextframe():
558
-        framenumber = own["framenum"]
559
-        framenumber = framenumber + 1
560
-        if framenumber == 900000:
561
-            framenumber = 0
562
-        own["framenum"] = framenumber
563
-        own['last_walk_frame'] = framenumber
534
+    # def nextframe():
535
+    #     framenumber = own["framenum"]
536
+    #     framenumber = framenumber + 1
537
+    #     if framenumber == 900000:
538
+    #         framenumber = 0
539
+    #     own["framenum"] = framenumber
540
+    #     own['last_walk_frame'] = framenumber
564
                 
541
                 
565
-    def checkidle():
566
-        idle = cont.sensors["idle"]
567
-        idle_frame = own["walk_idle_frame"]
568
-        if idle.positive:
569
-            own["walk_idle_frame"] = 0
570
-            cont.deactivate(camobj.actuators['idle_camRight'])  
571
-            #camera.height = .5
572
-            camera.height = dict['cam_idle_height']
573
-        else: 
574
-            if idle_frame == 0:
575
-                own["walk_idle_frame"] = own["framenum"] 
576
-            diff = own["framenum"] - idle_frame
542
+    # def checkidle():
543
+    #     idle = cont.sensors["idle"]
544
+    #     idle_frame = own["walk_idle_frame"]
545
+    #     if idle.positive:
546
+    #         own["walk_idle_frame"] = 0
547
+    #         cont.deactivate(camobj.actuators['idle_camRight'])  
548
+    #         #camera.height = .5
549
+    #         camera.height = dict['cam_idle_height']
550
+    #     else: 
551
+    #         if idle_frame == 0:
552
+    #             own["walk_idle_frame"] = own["framenum"] 
553
+    #         diff = own["framenum"] - idle_frame
577
             
554
             
578
-            if (diff > 700 and idle_frame != 0 and dropinCol.positive == False and own['walk'] != 0) or own['sit'] == 1:
579
-                cont.activate(camobj.actuators['idle_camRight'])  
580
-                #camera.height = .9   
581
-                #camera.min = 2
582
-                #camera.max = 2.50
583
-                own['walk_idling'] = 1
584
-            else:
585
-                own['walk_idling'] = 0    
555
+    #         if (diff > 700 and idle_frame != 0 and dropinCol.positive == False and own['walk'] != 0) or own['sit'] == 1:
556
+    #             cont.activate(camobj.actuators['idle_camRight'])  
557
+    #             #camera.height = .9   
558
+    #             #camera.min = 2
559
+    #             #camera.max = 2.50
560
+    #             own['walk_idling'] = 1
561
+    #         else:
562
+    #             own['walk_idling'] = 0    
586
                 
563
                 
587
-    def idle_anim():
588
-        if own['walk_idling'] == 1 and own['sit'] == 0:
589
-            walk_idle_frame = own['walk_idle_frame']
590
-            mod_num = (own["framenum"] - walk_idle_frame) % 240
591
-            idle_lay = 300
592
-            if mod_num == 0:
593
-                if own['idle_skipper'] > 0:
594
-                   own['idle_skipper'] -= 1 
595
-                ran_num = random.randint(1, 8)
596
-                if own['last_idle_num'] == ran_num:
597
-                    ran_num = 1
598
-                if own['idle_skipper'] == 0:
599
-                    own['last_idle_num'] = ran_num
600
-                    if ran_num == 1 or ran_num > 7:    
601
-                        killact(3)
602
-                        if STANCE == 0 and own['throw_deck'] == 0:
603
-                            own['requestAction'] = 'reg_idle1'
604
-                        elif STANCE == 0 and own['throw_deck'] == 1:
605
-                            own['requestAction'] = 'reg_idle1'
606
-                        elif STANCE == 1 and own['throw_deck'] == 0:
607
-                            own['requestAction'] = 'fak_idle1'
608
-                        elif STANCE == 1 and own['throw_deck'] == 1:
609
-                            own['requestAction'] = 'fak_idle1'
564
+    # def idle_anim():
565
+    #     if own['walk_idling'] == 1 and own['sit'] == 0:
566
+    #         walk_idle_frame = own['walk_idle_frame']
567
+    #         mod_num = (own["framenum"] - walk_idle_frame) % 240
568
+    #         idle_lay = 300
569
+    #         if mod_num == 0:
570
+    #             if own['idle_skipper'] > 0:
571
+    #                own['idle_skipper'] -= 1 
572
+    #             ran_num = random.randint(1, 8)
573
+    #             if own['last_idle_num'] == ran_num:
574
+    #                 ran_num = 1
575
+    #             if own['idle_skipper'] == 0:
576
+    #                 own['last_idle_num'] = ran_num
577
+    #                 if ran_num == 1 or ran_num > 7:    
578
+    #                     killact(3)
579
+    #                     if STANCE == 0 and own['throw_deck'] == 0:
580
+    #                         own['requestAction'] = 'reg_idle1'
581
+    #                     elif STANCE == 0 and own['throw_deck'] == 1:
582
+    #                         own['requestAction'] = 'reg_idle1'
583
+    #                     elif STANCE == 1 and own['throw_deck'] == 0:
584
+    #                         own['requestAction'] = 'fak_idle1'
585
+    #                     elif STANCE == 1 and own['throw_deck'] == 1:
586
+    #                         own['requestAction'] = 'fak_idle1'
610
                                                                                
587
                                                                                
611
-                    elif ran_num == 2:    
612
-                        killact(3)
613
-                        if STANCE == 0 and own['throw_deck'] == 0:
614
-                            own['requestAction'] = 'reg_idle2'
615
-                        elif STANCE == 0 and own['throw_deck'] == 1:
616
-                            own['requestAction'] = 'reg_idle2_nb'
617
-                        elif STANCE == 1 and own['throw_deck'] == 0:
618
-                            own['requestAction'] = 'fak_idle1'
619
-                        elif STANCE == 1 and own['throw_deck'] == 1:
620
-                            own['requestAction'] = 'fak_idle1'
621
-                    elif ran_num == 3:    
622
-                        killact(3)
623
-                        if STANCE == 0 and own['throw_deck'] == 0:
624
-                            own['requestAction'] = 'reg_idle3'
625
-                        elif STANCE == 0 and own['throw_deck'] == 1:
626
-                            own['requestAction'] = 'reg_idle3'
627
-                        elif STANCE == 1 and own['throw_deck'] == 0:
628
-                            own['requestAction'] = 'fak_idle1'
629
-                        elif STANCE == 1 and own['throw_deck'] == 1:
630
-                            own['requestAction'] = 'fak_idle1'
631
-                        own['idle_skipper'] = 2 
632
-                    elif ran_num == 4:    
633
-                        killact(3)
634
-                        if STANCE == 0 and own['throw_deck'] == 0:
635
-                            own['requestAction'] = 'reg_idle4'
636
-                        elif STANCE == 0 and own['throw_deck'] == 1:
637
-                            own['requestAction'] = 'reg_idle4'
638
-                        elif STANCE == 1 and own['throw_deck'] == 0:
639
-                            own['requestAction'] = 'fak_idle4'
640
-                        elif STANCE == 1 and own['throw_deck'] == 1:
641
-                            own['requestAction'] = 'fak_idle4' 
642
-                    elif ran_num == 5:    
643
-                        killact(3)
644
-                        if STANCE == 0 and own['throw_deck'] == 0:
645
-                            own['requestAction'] = 'reg_idle5'
646
-                        elif STANCE == 0 and own['throw_deck'] == 1:
647
-                            own['requestAction'] = 'reg_idle5'
648
-                        elif STANCE == 1 and own['throw_deck'] == 0:
649
-                            own['requestAction'] = 'fak_idle5'
650
-                        elif STANCE == 1 and own['throw_deck'] == 1:
651
-                            own['requestAction'] = 'fak_idle5'
652
-                    elif ran_num == 6:    
653
-                        killact(3)
654
-                        if STANCE == 0 and own['throw_deck'] == 0:
655
-                            own['requestAction'] = 'reg_idle6'
656
-                        elif STANCE == 0 and own['throw_deck'] == 1:
657
-                            own['requestAction'] = 'reg_idle6'
658
-                        elif STANCE == 1 and own['throw_deck'] == 0:
659
-                            own['requestAction'] = 'fak_idle6'
660
-                        elif STANCE == 1 and own['throw_deck'] == 1:
661
-                            own['requestAction'] = 'fak_idle6'
662
-                    elif ran_num == 7:    
663
-                        killact(3)
664
-                        if STANCE == 0 and own['throw_deck'] == 0:
665
-                            own['requestAction'] = 'reg_idle7'
666
-                        elif STANCE == 0 and own['throw_deck'] == 1:
667
-                            own['requestAction'] = 'reg_idle7'
668
-                        elif STANCE == 1 and own['throw_deck'] == 0:
669
-                            own['requestAction'] = 'fak_idle6'
670
-                        elif STANCE == 1 and own['throw_deck'] == 1:
671
-                            own['requestAction'] = 'fak_idle6'
588
+    #                 elif ran_num == 2:    
589
+    #                     killact(3)
590
+    #                     if STANCE == 0 and own['throw_deck'] == 0:
591
+    #                         own['requestAction'] = 'reg_idle2'
592
+    #                     elif STANCE == 0 and own['throw_deck'] == 1:
593
+    #                         own['requestAction'] = 'reg_idle2_nb'
594
+    #                     elif STANCE == 1 and own['throw_deck'] == 0:
595
+    #                         own['requestAction'] = 'fak_idle1'
596
+    #                     elif STANCE == 1 and own['throw_deck'] == 1:
597
+    #                         own['requestAction'] = 'fak_idle1'
598
+    #                 elif ran_num == 3:    
599
+    #                     killact(3)
600
+    #                     if STANCE == 0 and own['throw_deck'] == 0:
601
+    #                         own['requestAction'] = 'reg_idle3'
602
+    #                     elif STANCE == 0 and own['throw_deck'] == 1:
603
+    #                         own['requestAction'] = 'reg_idle3'
604
+    #                     elif STANCE == 1 and own['throw_deck'] == 0:
605
+    #                         own['requestAction'] = 'fak_idle1'
606
+    #                     elif STANCE == 1 and own['throw_deck'] == 1:
607
+    #                         own['requestAction'] = 'fak_idle1'
608
+    #                     own['idle_skipper'] = 2 
609
+    #                 elif ran_num == 4:    
610
+    #                     killact(3)
611
+    #                     if STANCE == 0 and own['throw_deck'] == 0:
612
+    #                         own['requestAction'] = 'reg_idle4'
613
+    #                     elif STANCE == 0 and own['throw_deck'] == 1:
614
+    #                         own['requestAction'] = 'reg_idle4'
615
+    #                     elif STANCE == 1 and own['throw_deck'] == 0:
616
+    #                         own['requestAction'] = 'fak_idle4'
617
+    #                     elif STANCE == 1 and own['throw_deck'] == 1:
618
+    #                         own['requestAction'] = 'fak_idle4' 
619
+    #                 elif ran_num == 5:    
620
+    #                     killact(3)
621
+    #                     if STANCE == 0 and own['throw_deck'] == 0:
622
+    #                         own['requestAction'] = 'reg_idle5'
623
+    #                     elif STANCE == 0 and own['throw_deck'] == 1:
624
+    #                         own['requestAction'] = 'reg_idle5'
625
+    #                     elif STANCE == 1 and own['throw_deck'] == 0:
626
+    #                         own['requestAction'] = 'fak_idle5'
627
+    #                     elif STANCE == 1 and own['throw_deck'] == 1:
628
+    #                         own['requestAction'] = 'fak_idle5'
629
+    #                 elif ran_num == 6:    
630
+    #                     killact(3)
631
+    #                     if STANCE == 0 and own['throw_deck'] == 0:
632
+    #                         own['requestAction'] = 'reg_idle6'
633
+    #                     elif STANCE == 0 and own['throw_deck'] == 1:
634
+    #                         own['requestAction'] = 'reg_idle6'
635
+    #                     elif STANCE == 1 and own['throw_deck'] == 0:
636
+    #                         own['requestAction'] = 'fak_idle6'
637
+    #                     elif STANCE == 1 and own['throw_deck'] == 1:
638
+    #                         own['requestAction'] = 'fak_idle6'
639
+    #                 elif ran_num == 7:    
640
+    #                     killact(3)
641
+    #                     if STANCE == 0 and own['throw_deck'] == 0:
642
+    #                         own['requestAction'] = 'reg_idle7'
643
+    #                     elif STANCE == 0 and own['throw_deck'] == 1:
644
+    #                         own['requestAction'] = 'reg_idle7'
645
+    #                     elif STANCE == 1 and own['throw_deck'] == 0:
646
+    #                         own['requestAction'] = 'fak_idle6'
647
+    #                     elif STANCE == 1 and own['throw_deck'] == 1:
648
+    #                         own['requestAction'] = 'fak_idle6'
672
 
649
 
673
-    def reset_pos():
674
-        #reset
675
-        if ddPad == 1:   
676
-            spawn_pos = own['spawn_pos']
677
-            spawn_rot = own['spawn_rot']
678
-            spawn_cam_pos = own['spawn_cam_pos']
679
-            spawn_cam_rot = own['spawn_cam_rot']            
680
-            try:
681
-                own.worldPosition = (spawn_pos[0], spawn_pos[1], (spawn_pos[2] + .1))
682
-                own.worldOrientation = [[spawn_rot[0][0],spawn_rot[0][1],spawn_rot[0][2]], [spawn_rot[1][0],spawn_rot[1][1],spawn_rot[1][2]], [0.0, 0.0, 1.0]]
683
-                cam.worldPosition = (spawn_cam_pos[0], spawn_cam_pos[1], (spawn_cam_pos[2]))
684
-                cam.worldOrientation = [[spawn_cam_rot[0][0],spawn_cam_rot[0][1],spawn_cam_rot[0][2]], [spawn_cam_rot[1][0],spawn_cam_rot[1][1],spawn_cam_rot[1][2]], [0.0, 0.0, 1.0]]            
685
-            except:    
686
-                own.worldPosition = (5, 2, .1)
687
-                own.worldOrientation = [[1.0, 0.0, 0.0], [ 0.0, 1.0, 0.0], [0.0, 0.0, 1.0]] 
688
-            own['stance'] = own['spawn_stance']                          
689
-            if own["spawn_stance"] == 1:
690
-                own.setLinearVelocity([.1,0,0], 1)
691
-            else: 
692
-                own.setLinearVelocity([-.1,0,0], 1)         
650
+    # def reset_pos():
651
+    #     #reset
652
+    #     if ddPad == 1:   
653
+    #         spawn_pos = own['spawn_pos']
654
+    #         spawn_rot = own['spawn_rot']
655
+    #         spawn_cam_pos = own['spawn_cam_pos']
656
+    #         spawn_cam_rot = own['spawn_cam_rot']            
657
+    #         try:
658
+    #             own.worldPosition = (spawn_pos[0], spawn_pos[1], (spawn_pos[2] + .1))
659
+    #             own.worldOrientation = [[spawn_rot[0][0],spawn_rot[0][1],spawn_rot[0][2]], [spawn_rot[1][0],spawn_rot[1][1],spawn_rot[1][2]], [0.0, 0.0, 1.0]]
660
+    #             cam.worldPosition = (spawn_cam_pos[0], spawn_cam_pos[1], (spawn_cam_pos[2]))
661
+    #             cam.worldOrientation = [[spawn_cam_rot[0][0],spawn_cam_rot[0][1],spawn_cam_rot[0][2]], [spawn_cam_rot[1][0],spawn_cam_rot[1][1],spawn_cam_rot[1][2]], [0.0, 0.0, 1.0]]            
662
+    #         except:    
663
+    #             own.worldPosition = (5, 2, .1)
664
+    #             own.worldOrientation = [[1.0, 0.0, 0.0], [ 0.0, 1.0, 0.0], [0.0, 0.0, 1.0]] 
665
+    #         own['stance'] = own['spawn_stance']                          
666
+    #         if own["spawn_stance"] == 1:
667
+    #             own.setLinearVelocity([.1,0,0], 1)
668
+    #         else: 
669
+    #             own.setLinearVelocity([-.1,0,0], 1)         
693
                 
670
                 
694
-        if udPad == 1:        
695
-            own['spawn_pos'] = [own.worldPosition[0], own.worldPosition[1], own.worldPosition[2]] 
696
-            own['spawn_rot'] = [[own.worldOrientation[0][0],own.worldOrientation[0][1],own.worldOrientation[0][2]], [own.worldOrientation[1][0],own.worldOrientation[1][1],own.worldOrientation[1][2]], own.worldOrientation[2][2]]
697
-            own['spawn_cam_pos'] = [cam.worldPosition[0], cam.worldPosition[1], cam.worldPosition[2]] 
698
-            own['spawn_cam_rot'] = [[cam.worldOrientation[0][0],cam.worldOrientation[0][1],cam.worldOrientation[0][2]], [cam.worldOrientation[1][0],cam.worldOrientation[1][1],cam.worldOrientation[1][2]], cam.worldOrientation[2][2]]            
699
-            stance = own["stance"]
700
-            own["spawn_stance"] = stance   
701
-    def falldeck():
702
-        throw_deck_empty = scene.objects["throw_deck_empty"]
703
-        throw_deck_empty.worldPosition.y += .5
704
-        throw_deck_empty.worldPosition.x += .5
705
-        deckact = deck.actuators["Visibility"]
706
-        trucksact = trucks.actuators["Visibility"]
707
-        wheel1act = wheel1.actuators["Visibility"]
708
-        wheel2act = wheel2.actuators["Visibility"]
709
-        wheel3act = wheel3.actuators["Visibility"]
710
-        wheel4act = wheel4.actuators["Visibility"]
711
-        print('doing falldeck')        
712
-        if own['throw_deck'] == False:
713
-            own['throw_deck'] = True
714
-            deckact.visibility = False
715
-            trucksact.visibility = False
716
-            wheel1act.visibility = False
717
-            wheel2act.visibility = False
718
-            wheel3act.visibility = False
719
-            wheel4act.visibility = False
720
-            act = throw_deck_empty.actuators['throw_dec_act']
721
-            if STANCE == True:
722
-                act.linearVelocity = [0.0, 1.0, 1.0]
723
-            if STANCE == False:
724
-                act.linearVelocity = [0.0, 1.0, -1.0]  
725
-            cont.activate(act)
726
-            print('running falldeck()')
727
-        else:
728
-            own['throw_deck'] = False    
729
-            deckact.visibility = True
730
-            trucksact.visibility = True
731
-            wheel1act.visibility = True
732
-            wheel2act.visibility = True
733
-            wheel3act.visibility = True
734
-            wheel4act.visibility = True
735
-            throw_deck_empty['kill_deck'] = 1    
736
-        cont.activate(deck.actuators['Visibility'])
737
-        cont.activate(trucks.actuators['Visibility'])
738
-        cont.activate(wheel1.actuators['Visibility'])
739
-        cont.activate(wheel2.actuators['Visibility'])
740
-        cont.activate(wheel3.actuators['Visibility'])
741
-        cont.activate(wheel4.actuators['Visibility']) 
671
+    #     if udPad == 1:        
672
+    #         own['spawn_pos'] = [own.worldPosition[0], own.worldPosition[1], own.worldPosition[2]] 
673
+    #         own['spawn_rot'] = [[own.worldOrientation[0][0],own.worldOrientation[0][1],own.worldOrientation[0][2]], [own.worldOrientation[1][0],own.worldOrientation[1][1],own.worldOrientation[1][2]], own.worldOrientation[2][2]]
674
+    #         own['spawn_cam_pos'] = [cam.worldPosition[0], cam.worldPosition[1], cam.worldPosition[2]] 
675
+    #         own['spawn_cam_rot'] = [[cam.worldOrientation[0][0],cam.worldOrientation[0][1],cam.worldOrientation[0][2]], [cam.worldOrientation[1][0],cam.worldOrientation[1][1],cam.worldOrientation[1][2]], cam.worldOrientation[2][2]]            
676
+    #         stance = own["stance"]
677
+    #         own["spawn_stance"] = stance   
678
+    # def falldeck():
679
+    #     throw_deck_empty = scene.objects["throw_deck_empty"]
680
+    #     throw_deck_empty.worldPosition.y += .5
681
+    #     throw_deck_empty.worldPosition.x += .5
682
+    #     deckact = deck.actuators["Visibility"]
683
+    #     trucksact = trucks.actuators["Visibility"]
684
+    #     wheel1act = wheel1.actuators["Visibility"]
685
+    #     wheel2act = wheel2.actuators["Visibility"]
686
+    #     wheel3act = wheel3.actuators["Visibility"]
687
+    #     wheel4act = wheel4.actuators["Visibility"]
688
+    #     print('doing falldeck')        
689
+    #     if own['throw_deck'] == False:
690
+    #         own['throw_deck'] = True
691
+    #         deckact.visibility = False
692
+    #         trucksact.visibility = False
693
+    #         wheel1act.visibility = False
694
+    #         wheel2act.visibility = False
695
+    #         wheel3act.visibility = False
696
+    #         wheel4act.visibility = False
697
+    #         act = throw_deck_empty.actuators['throw_dec_act']
698
+    #         if STANCE == True:
699
+    #             act.linearVelocity = [0.0, 1.0, 1.0]
700
+    #         if STANCE == False:
701
+    #             act.linearVelocity = [0.0, 1.0, -1.0]  
702
+    #         cont.activate(act)
703
+    #         print('running falldeck()')
704
+    #     else:
705
+    #         own['throw_deck'] = False    
706
+    #         deckact.visibility = True
707
+    #         trucksact.visibility = True
708
+    #         wheel1act.visibility = True
709
+    #         wheel2act.visibility = True
710
+    #         wheel3act.visibility = True
711
+    #         wheel4act.visibility = True
712
+    #         throw_deck_empty['kill_deck'] = 1    
713
+    #     cont.activate(deck.actuators['Visibility'])
714
+    #     cont.activate(trucks.actuators['Visibility'])
715
+    #     cont.activate(wheel1.actuators['Visibility'])
716
+    #     cont.activate(wheel2.actuators['Visibility'])
717
+    #     cont.activate(wheel3.actuators['Visibility'])
718
+    #     cont.activate(wheel4.actuators['Visibility']) 
742
 
719
 
743
-    def throwdeck(strength, ud):
744
-        throw_deck_empty = scene.objects["throw_deck_empty"]
745
-        deckact = deck.actuators["Visibility"]
746
-        trucksact = trucks.actuators["Visibility"]
747
-        wheel1act = wheel1.actuators["Visibility"]
748
-        wheel2act = wheel2.actuators["Visibility"]
749
-        wheel3act = wheel3.actuators["Visibility"]
750
-        wheel4act = wheel4.actuators["Visibility"]
720
+    # def throwdeck(strength, ud):
721
+    #     throw_deck_empty = scene.objects["throw_deck_empty"]
722
+    #     deckact = deck.actuators["Visibility"]
723
+    #     trucksact = trucks.actuators["Visibility"]
724
+    #     wheel1act = wheel1.actuators["Visibility"]
725
+    #     wheel2act = wheel2.actuators["Visibility"]
726
+    #     wheel3act = wheel3.actuators["Visibility"]
727
+    #     wheel4act = wheel4.actuators["Visibility"]
751
                 
728
                 
752
-        if own['throw_deck'] == False:
753
-            own['throw_deck'] = True
754
-            deckact.visibility = False
755
-            trucksact.visibility = False
756
-            wheel1act.visibility = False
757
-            wheel2act.visibility = False
758
-            wheel3act.visibility = False
759
-            wheel4act.visibility = False
760
-            act = throw_deck_empty.actuators['throw_dec_act']
761
-            hard = strength * .08
762
-            if hard > 9:
763
-                hard = 9
764
-            if hard < 1:
765
-                hard = 1    
766
-            ud = ud * 4
767
-            own['bbut_timer'] = 0
768
-            if STANCE == True:
769
-                own['requestAction'] = 'fak_throw'
770
-                act.linearVelocity = [0.0, ud, hard]
771
-            if STANCE == False:
772
-                own['requestAction'] = 'fak_throw'
773
-                act.linearVelocity = [0.0, ud, -hard]  
774
-            cont.activate(act)
775
-        else:
776
-            own['throw_deck'] = False    
777
-            deckact.visibility = True
778
-            trucksact.visibility = True
779
-            wheel1act.visibility = True
780
-            wheel2act.visibility = True
781
-            wheel3act.visibility = True
782
-            wheel4act.visibility = True
783
-            throw_deck_empty['kill_deck'] = 1     
784
-        cont.activate(deck.actuators['Visibility'])
785
-        cont.activate(trucks.actuators['Visibility'])
786
-        cont.activate(wheel1.actuators['Visibility'])
787
-        cont.activate(wheel2.actuators['Visibility'])
788
-        cont.activate(wheel3.actuators['Visibility'])
789
-        cont.activate(wheel4.actuators['Visibility'])            
790
-    def throwdeck_trigger():
791
-        lastb = own['lastb']
792
-        throw_deck_empty = scene.objects["throw_deck_empty"]
793
-        if bBut == True:
794
-            own['bbut_timer'] += 1
795
-            ud = (rUD * 10) +1
796
-        if bBut == False:
797
-            throw_deck_empty['kill_deck'] = 0
798
-        if bBut == False and own['lastb'] == True:        
799
-            strength = own['bbut_timer']
800
-            ud = (rUD * 10) +1
801
-            throwdeck(strength, ud)   
729
+    #     if own['throw_deck'] == False:
730
+    #         own['throw_deck'] = True
731
+    #         deckact.visibility = False
732
+    #         trucksact.visibility = False
733
+    #         wheel1act.visibility = False
734
+    #         wheel2act.visibility = False
735
+    #         wheel3act.visibility = False
736
+    #         wheel4act.visibility = False
737
+    #         act = throw_deck_empty.actuators['throw_dec_act']
738
+    #         hard = strength * .08
739
+    #         if hard > 9:
740
+    #             hard = 9
741
+    #         if hard < 1:
742
+    #             hard = 1    
743
+    #         ud = ud * 4
744
+    #         own['bbut_timer'] = 0
745
+    #         if STANCE == True:
746
+    #             own['requestAction'] = 'fak_throw'
747
+    #             act.linearVelocity = [0.0, ud, hard]
748
+    #         if STANCE == False:
749
+    #             own['requestAction'] = 'fak_throw'
750
+    #             act.linearVelocity = [0.0, ud, -hard]  
751
+    #         cont.activate(act)
752
+    #     else:
753
+    #         own['throw_deck'] = False    
754
+    #         deckact.visibility = True
755
+    #         trucksact.visibility = True
756
+    #         wheel1act.visibility = True
757
+    #         wheel2act.visibility = True
758
+    #         wheel3act.visibility = True
759
+    #         wheel4act.visibility = True
760
+    #         throw_deck_empty['kill_deck'] = 1     
761
+    #     cont.activate(deck.actuators['Visibility'])
762
+    #     cont.activate(trucks.actuators['Visibility'])
763
+    #     cont.activate(wheel1.actuators['Visibility'])
764
+    #     cont.activate(wheel2.actuators['Visibility'])
765
+    #     cont.activate(wheel3.actuators['Visibility'])
766
+    #     cont.activate(wheel4.actuators['Visibility'])            
767
+    # def throwdeck_trigger():
768
+    #     lastb = own['lastb']
769
+    #     throw_deck_empty = scene.objects["throw_deck_empty"]
770
+    #     if bBut == True:
771
+    #         own['bbut_timer'] += 1
772
+    #         ud = (rUD * 10) +1
773
+    #     if bBut == False:
774
+    #         throw_deck_empty['kill_deck'] = 0
775
+    #     if bBut == False and own['lastb'] == True:        
776
+    #         strength = own['bbut_timer']
777
+    #         ud = (rUD * 10) +1
778
+    #         throwdeck(strength, ud)   
802
             
779
             
803
-    def focus_deck():
804
-        since_air = own['framenum'] - own['lF_air_frame']
805
-        if cb_td.positive and since_air < 10:
806
-            object = 'focus_deckA'
807
-            object2 = 'focus_deckB'            
808
-            other = throw_deck_empty
809
-            throw_deck = scene.objects["throw_deck"]
810
-            throw_deck.endObject()
811
-            scene.addObject(object, other, 0)          
812
-            scene.addObject(object2, other, 0)
780
+    # def focus_deck():
781
+    #     since_air = own['framenum'] - own['lF_air_frame']
782
+    #     if cb_td.positive and since_air < 10:
783
+    #         object = 'focus_deckA'
784
+    #         object2 = 'focus_deckB'            
785
+    #         other = throw_deck_empty
786
+    #         throw_deck = scene.objects["throw_deck"]
787
+    #         throw_deck.endObject()
788
+    #         scene.addObject(object, other, 0)          
789
+    #         scene.addObject(object2, other, 0)
813
                     
790
                     
814
-        if own['throw_deck'] == True:
815
-            if dict['ldPad'] == False and dict['last_ldPad'] == True: 
816
-                object = 'focus_deckA'
817
-                object2 = 'focus_deckB'            
818
-                other = throw_deck_empty
819
-                scene.addObject(object, other, 0)          
820
-                scene.addObject(object2, other, 0)          
791
+    #     if own['throw_deck'] == True:
792
+    #         if dict['ldPad'] == False and dict['last_ldPad'] == True: 
793
+    #             object = 'focus_deckA'
794
+    #             object2 = 'focus_deckB'            
795
+    #             other = throw_deck_empty
796
+    #             scene.addObject(object, other, 0)          
797
+    #             scene.addObject(object2, other, 0)          
821
                   
798
                   
822
-    def fall():
823
-        if own['fall'] == True:
824
-            falldeck()        
825
-            if STANCE == 1:
826
-                own['requestAction'] = 'fak_air-walk_air'            
827
-                #own.setLinearVelocity([3,2,0], True)
828
-            else:
829
-                own['requestAction'] = 'reg_air-walk_air'
830
-                #own.setLinearVelocity([-3,-2,0], True)    
831
-            own['fall'] = False
832
-            own.worldPosition.z += .3
833
-            print('falling from walk.py')
799
+    # def fall():
800
+    #     if own['fall'] == True:
801
+    #         falldeck()        
802
+    #         if STANCE == 1:
803
+    #             own['requestAction'] = 'fak_air-walk_air'            
804
+    #             #own.setLinearVelocity([3,2,0], True)
805
+    #         else:
806
+    #             own['requestAction'] = 'reg_air-walk_air'
807
+    #             #own.setLinearVelocity([-3,-2,0], True)    
808
+    #         own['fall'] = False
809
+    #         own.worldPosition.z += .3
810
+    #         print('falling from walk.py')
834
 
811
 
835
-    def sit():
836
-        #turn off sit
837
-        if lup == 1 or ldown == 1 or lUD > sens or lUD < -sens:
838
-            if own['sit'] == 1:
839
-                killact(300)
840
-                killact(299)
841
-            own['sit'] = 0
812
+    # def sit():
813
+    #     #turn off sit
814
+    #     if lup == 1 or ldown == 1 or lUD > sens or lUD < -sens:
815
+    #         if own['sit'] == 1:
816
+    #             killact(300)
817
+    #             killact(299)
818
+    #         own['sit'] = 0
842
 
819
 
843
-        if aBut == True and lasta == False:
844
-            try:
845
-                if 'sit' in r_ground.hitObject:
846
-                    #print("sit")
847
-                    own['sit'] = 1
848
-                    killact(3)
849
-                    if STANCE == 0:
850
-                        own['requestAction'] = 'reg_sit'
851
-                    elif STANCE == 1:
852
-                        own['requestAction'] = 'fak_sit'                                        
853
-            except:
854
-                pass    
855
-        if own['sit'] == 1:
856
-            try:
857
-                killact(3)
858
-                sit_vect = r_ground.hitObject.getAxisVect( [0, 1, 0])
859
-                if STANCE == 0:
860
-                    own.alignAxisToVect(-sit_vect, 0, .2)
861
-                    own['requestAction'] = 'reg_sit'                               
820
+    #     if aBut == True and lasta == False:
821
+    #         try:
822
+    #             if 'sit' in r_ground.hitObject:
823
+    #                 #print("sit")
824
+    #                 own['sit'] = 1
825
+    #                 killact(3)
826
+    #                 if STANCE == 0:
827
+    #                     own['requestAction'] = 'reg_sit'
828
+    #                 elif STANCE == 1:
829
+    #                     own['requestAction'] = 'fak_sit'                                        
830
+    #         except:
831
+    #             pass    
832
+    #     if own['sit'] == 1:
833
+    #         try:
834
+    #             killact(3)
835
+    #             sit_vect = r_ground.hitObject.getAxisVect( [0, 1, 0])
836
+    #             if STANCE == 0:
837
+    #                 own.alignAxisToVect(-sit_vect, 0, .2)
838
+    #                 own['requestAction'] = 'reg_sit'                               
862
                     
839
                     
863
-                elif STANCE == 1:
864
-                    own['requestAction'] = 'fak_sit'
865
-                    own.alignAxisToVect(sit_vect, 0, .2)                    
866
-            except:
867
-                pass    
840
+    #             elif STANCE == 1:
841
+    #                 own['requestAction'] = 'fak_sit'
842
+    #                 own.alignAxisToVect(sit_vect, 0, .2)                    
843
+    #         except:
844
+    #             pass    
868
                           
845
                           
869
-    def switchcam():
870
-        if ltsBut == False and own['lastlts'] == True and rtsBut == False:
871
-            if own['camera'] == 1:
872
-                own['camera'] = 0
873
-            else:
874
-                own['camera'] = 1
875
-        if rtsBut == False and own['lastrts'] == True and ltsBut == False:
876
-            if own['camera'] == 2:
877
-                own['camera'] = 0
878
-            else:
879
-                own['camera'] = 2 
880
-    #followcam 
881
-    def move_followcam():
882
-        if own['camera'] == 2:
883
-            if own['lastbkBut'] == True and bkBut == False:
884
-                #print("activate move followcam") 
885
-                if own['move_followcam'] == False:
886
-                    own['move_followcam'] = True
887
-                else:
888
-                    own['move_followcam'] = False                       
889
-            if own['move_followcam'] == True:
890
-                camspeed1 = .015
891
-                camspeed2 = .055
892
-                camrot1 = .005
893
-                camrot2 = .02
894
-                #up
895
-                if lUD < -0.080:
896
-                    followcam.actuators["up"].dLoc = [ 0, 0, -camspeed2]
897
-                    cont.activate(followcam.actuators["up"])
898
-                    #print("fastup")
899
-                else:
900
-                    cont.deactivate(followcam.actuators["up"])    
901
-    #            #down    
902
-                if lUD > .080:
903
-                    followcam.actuators["down"].dLoc = [ 0, 0, camspeed2]
904
-                    cont.activate(followcam.actuators["down"])
905
-                else:
906
-                    cont.deactivate(followcam.actuators["down"])                    
907
-    #            #left
908
-                #if lLR < -0.080:
909
-                if lLR > 0.080:    
910
-                    followcam.actuators["left"].dLoc = [-camspeed2, 0, 0]                
911
-                    cont.activate(followcam.actuators["left"])
912
-                else:
913
-                    cont.deactivate(followcam.actuators["left"])                    
914
-    #            #right
915
-                #if lLR > 0.080: 
916
-                if lLR < -0.080:         
917
-                    followcam.actuators["right"].dLoc = [camspeed2, 0, 0]                
918
-                    cont.activate(followcam.actuators["right"])
919
-                else:
920
-                    cont.deactivate(followcam.actuators["right"])  
921
-                #up
922
-                if rUD < -0.080:
923
-                    followcam.actuators["rotup"].dLoc = [0, 0, camrot2]
924
-                    cont.activate(followcam.actuators["rotup"])
925
-                else:
926
-                    cont.deactivate(followcam.actuators["rotup"])    
927
-    #            #down    
928
-                if rUD > .080:
929
-                    followcam.actuators["rotdown"].dLoc = [0, 0, -camrot2]                
930
-                    cont.activate(followcam.actuators["rotdown"])
931
-                else:
932
-                    cont.deactivate(followcam.actuators["rotdown"])                    
933
-    #            #left
934
-                if rLR < -0.080:
935
-                    followcam.actuators["rotleft"].dRot = [0, 0, camrot2]                
936
-                    cont.activate(followcam.actuators["rotleft"])
937
-                else:
938
-                    cont.deactivate(followcam.actuators["rotleft"])                    
939
-    #            #right
940
-                if rLR > 0.080:         
941
-                    followcam.actuators["rotright"].dRot = [0, 0, -camrot2]
942
-                    cont.activate(followcam.actuators["rotright"])
943
-                else:
944
-                    cont.deactivate(followcam.actuators["rotright"]) 
945
-
946
-    #*********************************************                
947
-                    
948
-                if lUD > -0.080 and lUD < -0.030:
949
-                    followcam.actuators["up"].dLoc = [ 0, 0, -camspeed1]
950
-                    cont.activate(followcam.actuators["up"])
951
-                else:
952
-                    cont.deactivate(followcam.actuators["up"])    
953
-    #            #down    
954
-                if lUD < .080 and lUD > .03:
955
-                    followcam.actuators["down"].dLoc = [ 0, 0, camspeed1]                
956
-                    cont.activate(followcam.actuators["down"])
957
-                else:
958
-                    cont.deactivate(followcam.actuators["down"])                    
959
-    #            #left
960
-                if lLR > -0.080 and lLR < -0.030:
961
-                    followcam.actuators["left"].dLoc = [-camspeed1, 0, 0]                
962
-                    cont.activate(followcam.actuators["left"])
963
-                else:
964
-                    cont.deactivate(followcam.actuators["left"])                    
965
-    #            #right
966
-                if lLR < .080 and lLR > .03:       
967
-                    followcam.actuators["right"].dLoc = [camspeed1, 0, 0]
968
-                    cont.activate(followcam.actuators["right"])
969
-                else:
970
-                    cont.deactivate(followcam.actuators["right"])  
971
-                #up
972
-                if rUD > -0.080 and rUD < -0.030:
973
-                    followcam.actuators["rotup"].dRot = [camrot1, 0, 0]                
974
-                    cont.activate(followcam.actuators["rotup"])
975
-                else:
976
-                    cont.deactivate(followcam.actuators["rotup"])    
977
-    #            #down    
978
-                if rUD < .080 and rUD > .03:
979
-                    followcam.actuators["rotdown"].dRot = [-camrot1, 0, 0]                
980
-                    cont.activate(followcam.actuators["rotdown"])
981
-                else:
982
-                    cont.deactivate(followcam.actuators["rotdown"])                    
983
-    #            #left
984
-                if rLR > -0.080 and rLR < -0.030:
985
-                    followcam.actuators["rotleft"].dRot = [0, 0, camrot1]
986
-                    cont.activate(followcam.actuators["rotleft"])
987
-                else:
988
-                    cont.deactivate(followcam.actuators["rotleft"])                    
989
-    #            #right
990
-                if rLR < .080 and rLR > .03:         
991
-                    followcam.actuators["rotright"].dRot = [0, 0, -camrot1]
992
-                    cont.activate(followcam.actuators["rotright"])
993
-                else:
994
-                    cont.deactivate(followcam.actuators["rotright"])                       
995
-    def move_flycam():
996
-        if own['camera'] == 1:
997
-            if own['lastbkBut'] == True and bkBut == False: 
998
-                if own['move_freecam'] == False:
999
-                    own['move_freecam'] = True
1000
-                else:
1001
-                    own['move_freecam'] = False                       
1002
-            if own['move_freecam'] == True:
1003
-                camspeed1 = .015
1004
-                camspeed2 = .055
1005
-                camrot1 = .005
1006
-                camrot2 = .02
1007
-                #up
1008
-                if lUD < -0.080:
1009
-                    freecam.actuators["up"].dLoc = [ 0, 0, -camspeed2]
1010
-                    cont.activate(freecam.actuators["up"])
1011
-                else:
1012
-                    cont.deactivate(freecam.actuators["up"])    
1013
-    #            #down    
1014
-                if lUD > .080:
1015
-                    freecam.actuators["down"].dLoc = [ 0, 0, camspeed2]
1016
-                    cont.activate(freecam.actuators["down"])
1017
-                else:
1018
-                    cont.deactivate(freecam.actuators["down"])                    
1019
-    #            #left
1020
-                if lLR < -0.080:
1021
-                    freecam.actuators["left"].dLoc = [-camspeed2, 0, 0]                
1022
-                    cont.activate(freecam.actuators["left"])
1023
-                else:
1024
-                    cont.deactivate(freecam.actuators["left"])                    
1025
-    #            #right
1026
-                if lLR > 0.080:         
1027
-                    freecam.actuators["right"].dLoc = [camspeed2, 0, 0]                
1028
-                    cont.activate(freecam.actuators["right"])
1029
-                else:
1030
-                    cont.deactivate(freecam.actuators["right"])  
1031
-                #up
1032
-                if rUD < -0.080:
1033
-                    freecam.actuators["rotup"].dRot = [camrot2, 0, 0]
1034
-                    cont.activate(freecam.actuators["rotup"])
1035
-                else:
1036
-                    cont.deactivate(freecam.actuators["rotup"])    
1037
-    #            #down    
1038
-                if rUD > .080:
1039
-                    freecam.actuators["rotdown"].dRot = [-camrot2, 0, 0]                
1040
-                    cont.activate(freecam.actuators["rotdown"])
1041
-                else:
1042
-                    cont.deactivate(freecam.actuators["rotdown"])                    
1043
-    #            #left
1044
-                if rLR < -0.080:
1045
-                    freecam.actuators["rotleft"].dRot = [0, 0, camrot2]                
1046
-                    cont.activate(freecam.actuators["rotleft"])
1047
-                else:
1048
-                    cont.deactivate(freecam.actuators["rotleft"])                    
1049
-    #            #right
1050
-                if rLR > 0.080:         
1051
-                    freecam.actuators["rotright"].dRot = [0, 0, -camrot2]
1052
-                    cont.activate(freecam.actuators["rotright"])
1053
-                else:
1054
-                    cont.deactivate(freecam.actuators["rotright"]) 
1055
-
1056
-    #*********************************************                
1057
                     
846
                     
1058
-                if lUD > -0.080 and lUD < -0.030:
1059
-                    freecam.actuators["up"].dLoc = [ 0, 0, -camspeed1]
1060
-                    cont.activate(freecam.actuators["up"])
1061
-                    #print(lUD)
1062
-                else:
1063
-                    cont.deactivate(freecam.actuators["up"])    
1064
-    #            #down    
1065
-                if lUD < .080 and lUD > .03:
1066
-                    freecam.actuators["down"].dLoc = [ 0, 0, camspeed1]                
1067
-                    cont.activate(freecam.actuators["down"])
1068
-                else:
1069
-                    cont.deactivate(freecam.actuators["down"])                    
1070
-    #            #left
1071
-                if lLR > -0.080 and lLR < -0.030:
1072
-                    freecam.actuators["left"].dLoc = [-camspeed1, 0, 0]                
1073
-                    cont.activate(freecam.actuators["left"])
1074
-                else:
1075
-                    cont.deactivate(freecam.actuators["left"])                    
1076
-    #            #right
1077
-                if lLR < .080 and lLR > .03:       
1078
-                    freecam.actuators["right"].dLoc = [camspeed1, 0, 0]
1079
-                    cont.activate(freecam.actuators["right"])
1080
-                else:
1081
-                    cont.deactivate(freecam.actuators["right"])  
1082
-                #up
1083
-                if rUD > -0.080 and rUD < -0.030:
1084
-                    freecam.actuators["rotup"].dRot = [camrot1, 0, 0]                
1085
-                    cont.activate(freecam.actuators["rotup"])
1086
-                else:
1087
-                    cont.deactivate(freecam.actuators["rotup"])    
1088
-    #            #down    
1089
-                if rUD < .080 and rUD > .03:
1090
-                    freecam.actuators["rotdown"].dRot = [-camrot1, 0, 0]                
1091
-                    cont.activate(freecam.actuators["rotdown"])
1092
-                else:
1093
-                    cont.deactivate(freecam.actuators["rotdown"])                    
1094
-    #            #left
1095
-                if rLR > -0.080 and rLR < -0.030:
1096
-                    freecam.actuators["rotleft"].dRot = [0, 0, camrot1]
1097
-                    cont.activate(freecam.actuators["rotleft"])
1098
-                else:
1099
-                    cont.deactivate(freecam.actuators["rotleft"])                    
1100
-    #            #right
1101
-                if rLR < .080 and rLR > .03:         
1102
-                    freecam.actuators["rotright"].dRot = [0, 0, -camrot1]
1103
-                    cont.activate(freecam.actuators["rotright"])
1104
-                else:
1105
-                    cont.deactivate(freecam.actuators["rotright"])                     
1106
-    if r_ground.triggered == False:
1107
-        cont.deactivate(own.actuators["walk_align"])
1108
-    else:
1109
-        cont.activate(own.actuators["walk_align"])                    
847
+    # if r_ground.triggered == False:
848
+    #     cont.deactivate(own.actuators["walk_align"])
849
+    # else:
850
+    #     cont.activate(own.actuators["walk_align"])                    
1110
 
851
 
1111
-    #walking on stairs
1112
-    if r_ground.triggered:
1113
-        try:
1114
-            if 'stair' in r_ground.hitObject:
1115
-                own['stair_counter'] = 20
852
+    # #walking on stairs
853
+    # if r_ground.triggered:
854
+    #     try:
855
+    #         if 'stair' in r_ground.hitObject:
856
+    #             own['stair_counter'] = 20
1116
                 
857
                 
1117
-        except:
1118
-            pass        
1119
-        if own['stair_counter'] > 0:
1120
-            own.linearVelocity.z += .1
1121
-            own['stair_counter'] -= 1     
858
+    #     except:
859
+    #         pass        
860
+    #     if own['stair_counter'] > 0:
861
+    #         own.linearVelocity.z += .1
862
+    #         own['stair_counter'] -= 1     
1122
 
863
 
1123
-    if yBut == True:
1124
-        own['walk_idling'] = 0
1125
-        own["walk_idle_frame"] = 0
864
+    # if yBut == True:
865
+    #     own['walk_idling'] = 0
866
+    #     own["walk_idle_frame"] = 0
1126
 
867
 
1127
 
868
 
1128
 
869
 
1129
-    if own['stair_counter'] > 5 and r_ground.triggered == False:
1130
-        own.applyForce([0,0,-200], True)                          
870
+    # if own['stair_counter'] > 5 and r_ground.triggered == False:
871
+    #     own.applyForce([0,0,-200], True)                          
1131
        
872
        
1132
-    if deck.visible:
1133
-        own['deckvis'] = 1
1134
-    else:
1135
-        own['deckvis'] = 0       
873
+    # if deck.visible:
874
+    #     own['deckvis'] = 1
875
+    # else:
876
+    #     own['deckvis'] = 0       
1136
 
877
 
1137
-    if own['requestAction'] == 'empty' or own['requestAction'] == None:
1138
-        if STANCE == 0:
1139
-            own['requestAction'] = 'reg_idle1'
1140
-        if STANCE == 1:
1141
-            own['requestAction'] = 'fak_idle1'        
878
+    # if own['requestAction'] == 'empty' or own['requestAction'] == None:
879
+    #     if STANCE == 0:
880
+    #         own['requestAction'] = 'reg_idle1'
881
+    #     if STANCE == 1:
882
+    #         own['requestAction'] = 'fak_idle1'        
1142
         
883
         
1143
-    def onground():
1144
-        if r_ground.positive:
1145
-            own['lF_ground_frame'] = own['framenum']
1146
-            if 'grind' in r_ground.hitObject:
1147
-                if own['framenum'] - own['last_fall_frame'] < 90:
1148
-                    #own.applyForce([0,100,0], True)
1149
-                    pass
1150
-                    #print('moving away from rail')
884
+    # def onground():
885
+    #     if r_ground.positive:
886
+    #         own['lF_ground_frame'] = own['framenum']
887
+    #         if 'grind' in r_ground.hitObject:
888
+    #             if own['framenum'] - own['last_fall_frame'] < 90:
889
+    #                 #own.applyForce([0,100,0], True)
890
+    #                 pass
891
+    #                 #print('moving away from rail')
1151
                     
892
                     
1152
-            yvel = own.linearVelocity.y
1153
-            yvel = yvel *.1
1154
-            if own.linearVelocity.y > .01 or own.linearVelocity.y < -.01 and own['stair_counter'] == 0:
1155
-                if STANCE == 0:
1156
-                    own.applyRotation([0,0,-yvel], True) 
1157
-                else:
1158
-                    own.applyRotation([0,0,yvel], True) 
1159
-            else:
1160
-                own.linearVelocity.y = 0                           
893
+    #         yvel = own.linearVelocity.y
894
+    #         yvel = yvel *.1
895
+    #         if own.linearVelocity.y > .01 or own.linearVelocity.y < -.01 and own['stair_counter'] == 0:
896
+    #             if STANCE == 0:
897
+    #                 own.applyRotation([0,0,-yvel], True) 
898
+    #             else:
899
+    #                 own.applyRotation([0,0,yvel], True) 
900
+    #         else:
901
+    #             own.linearVelocity.y = 0                           
1161
 
902
 
1162
-        else:
1163
-            #print('in air')            
1164
-            if  own['framenum'] - own['lF_ground_frame'] > 10:
1165
-                if STANCE == 0:            
1166
-                    own['requestAction'] = 'reg_walk_air'
1167
-                else:
1168
-                    own['requestAction'] = 'fak_walk_air' 
1169
-        #if control bottom is touching ground object, turn ground on            
1170
-        if cb.positive:
1171
-            if own['framenum'] - own['last_fall_frame'] < 90:
1172
-                own['lF_ground_frame'] = own['framenum']
903
+    #     else:
904
+    #         #print('in air')            
905
+    #         if  own['framenum'] - own['lF_ground_frame'] > 10:
906
+    #             if STANCE == 0:            
907
+    #                 own['requestAction'] = 'reg_walk_air'
908
+    #             else:
909
+    #                 own['requestAction'] = 'fak_walk_air' 
910
+    #     #if control bottom is touching ground object, turn ground on            
911
+    #     if cb.positive:
912
+    #         if own['framenum'] - own['last_fall_frame'] < 90:
913
+    #             own['lF_ground_frame'] = own['framenum']
1173
                 
914
                 
1174
                 
915
                 
1175
 
916
 
1176
-    def get_in_car():
1177
-        vehicleNear = cont.sensors["vehicleNear"]
1178
-        #print('vh', vehicleNear.positive)
1179
-        scene = bge.logic.getCurrentScene()
1180
-        cam = scene.active_camera
1181
-        #dict = bge.logic.globalDict 
1182
-        if vehicleNear.positive and 'car' in vehicleNear.hitObject:
1183
-            obj = vehicleNear.hitObject
1184
-            if yBut == True:
1185
-                obj['driving'] = True
1186
-                own['driving'] = True
1187
-                cube.suspendDynamics(True)
1188
-                cube.worldPosition = obj.worldPosition
1189
-                cube.worldOrientation = obj.worldOrientation
1190
-                rot = [ 0.0, 0.0, 1.570796327]
1191
-                cube.applyRotation(rot,False)            
1192
-                compound = False
917
+    # def get_in_car():
918
+    #     vehicleNear = cont.sensors["vehicleNear"]
919
+    #     #print('vh', vehicleNear.positive)
920
+    #     scene = bge.logic.getCurrentScene()
921
+    #     cam = scene.active_camera
922
+    #     #dict = bge.logic.globalDict 
923
+    #     if vehicleNear.positive and 'car' in vehicleNear.hitObject:
924
+    #         obj = vehicleNear.hitObject
925
+    #         if yBut == True:
926
+    #             obj['driving'] = True
927
+    #             own['driving'] = True
928
+    #             cube.suspendDynamics(True)
929
+    #             cube.worldPosition = obj.worldPosition
930
+    #             cube.worldOrientation = obj.worldOrientation
931
+    #             rot = [ 0.0, 0.0, 1.570796327]
932
+    #             cube.applyRotation(rot,False)            
933
+    #             compound = False
1193
 
934
 
1194
-                # child is solid
1195
-                ghost = True
935
+    #             # child is solid
936
+    #             ghost = True
1196
 
937
 
1197
-                # set parent
1198
-                cube.setParent( obj, compound, ghost)            
938
+    #             # set parent
939
+    #             cube.setParent( obj, compound, ghost)            
1199
                 
940
                 
1200
                 
941
                 
1201
 
942
 
1202
-                #cam.target = obj
1203
-                #cam.state = 2
1204
-                cont.actuators['Camera'].object = obj
1205
-                cont.actuators['Camera'].height = 3
1206
-                cont.actuators['Camera'].min = 6
1207
-                cont.actuators['Camera'].max = 10
1208
-                own.state = 2
1209
-            #print('near car')
943
+    #             #cam.target = obj
944
+    #             #cam.state = 2
945
+    #             cont.actuators['Camera'].object = obj
946
+    #             cont.actuators['Camera'].height = 3
947
+    #             cont.actuators['Camera'].min = 6
948
+    #             cont.actuators['Camera'].max = 10
949
+    #             own.state = 2
950
+    #         #print('near car')
1210
             
951
             
1211
-        if dict['last_driving'] == True:
1212
-            cont.actuators['Camera'].object = scene.objects['camCube']    
1213
-            cont.activate(cont.actuators['walk'])               
1214
-        if own['driving'] == False:  
1215
-            #cont.actuators['Camera'].object = scene.objects['camCube'] 
1216
-            #cont.activate(cont.actuators['walk']) 
1217
-            dict['last_driving'] = False
952
+    #     if dict['last_driving'] == True:
953
+    #         cont.actuators['Camera'].object = scene.objects['camCube']    
954
+    #         cont.activate(cont.actuators['walk'])               
955
+    #     if own['driving'] == False:  
956
+    #         #cont.actuators['Camera'].object = scene.objects['camCube'] 
957
+    #         #cont.activate(cont.actuators['walk']) 
958
+    #         dict['last_driving'] = False
1218
             
959
             
1219
-    def get_on_bike(dict, own):
1220
-        #bikeCol = cont.sensors['bikeCol']
1221
-        vehicleNear = cont.sensors["vehicleNear"]
1222
-        #print('vh', vehicleNear.positive)
1223
-        scene = bge.logic.getCurrentScene()
1224
-        #cam = scene.active_camera
1225
-        #dict = bge.logic.globalDict 
1226
-        try:
1227
-            if vehicleNear.positive and 'bike' in vehicleNear.hitObject:          
1228
-                if yBut == True and dict['last_yBut'] == False and own['throw_deck'] == True:
1229
-                    vehicleNear.hitObject.endObject()
1230
-                    dict['bike'] = True 
1231
-                    cont.activate(own.actuators['bike_state']) 
960
+    # def get_on_bike(dict, own):
961
+    #     #bikeCol = cont.sensors['bikeCol']
962
+    #     vehicleNear = cont.sensors["vehicleNear"]
963
+    #     #print('vh', vehicleNear.positive)
964
+    #     scene = bge.logic.getCurrentScene()
965
+    #     #cam = scene.active_camera
966
+    #     #dict = bge.logic.globalDict 
967
+    #     try:
968
+    #         if vehicleNear.positive and 'bike' in vehicleNear.hitObject:          
969
+    #             if yBut == True and dict['last_yBut'] == False and own['throw_deck'] == True:
970
+    #                 vehicleNear.hitObject.endObject()
971
+    #                 dict['bike'] = True 
972
+    #                 cont.activate(own.actuators['bike_state']) 
1232
 
973
 
1233
-                    object = "player_bike"
1234
-                    # instantly add bullet
1235
-                    newbike = scene.addObject(object, own, 0)
1236
-                    #bike.localScale = 4.6            
1237
-                    newbike.setParent(cube, False, False)
1238
-                    #rot = [ 0.0, 0.0, 1.570796327]
1239
-                    #bike.applyRotation(rot,False) 
1240
-        except:
1241
-            pass            
974
+    #                 object = "player_bike"
975
+    #                 # instantly add bullet
976
+    #                 newbike = scene.addObject(object, own, 0)
977
+    #                 #bike.localScale = 4.6            
978
+    #                 newbike.setParent(cube, False, False)
979
+    #                 #rot = [ 0.0, 0.0, 1.570796327]
980
+    #                 #bike.applyRotation(rot,False) 
981
+    #     except:
982
+    #         pass            
1242
                                                   
983
                                                   
1243
-    if dict['driving_reset'] == True:
1244
-        scene.resume()
1245
-        cube.suspendDynamics(False)
1246
-        cont.actuators['Camera'].object = camobj2
1247
-        cont.activate(own.actuators['walk'])
1248
-        #dict['driving_reset'] = False
1249
-        #print('reseting driving')   
1250
-    if own['walk_jump_timer'] != 0:
1251
-        own['walk_jump_timer'] = own['walk_jump_timer'] - 1    
1252
-    wts = own['walk_targ_speed'] +1                 
1253
-    if own['requestAction'] == 'reg_walkFast' and own.linearVelocity.x > (wts * -1):
1254
-        own['requestAction'] = 'reg_walk' 
1255
-    if own['requestAction'] == 'fak_walkFast' and own.linearVelocity.x < wts:
1256
-        own['requestAction'] = 'fak_walk' 
1257
-    if own['requestAction'] == 'reg_walkFast_nb' and own.linearVelocity.x > (wts * -1):
1258
-        own['requestAction'] = 'reg_walk_nb' 
1259
-    if own['requestAction'] == 'fak_walkFast_nb' and own.linearVelocity.x < wts:
1260
-        own['requestAction'] = 'fak_walk_nb'   
984
+    # if dict['driving_reset'] == True:
985
+    #     scene.resume()
986
+    #     cube.suspendDynamics(False)
987
+    #     cont.actuators['Camera'].object = camobj2
988
+    #     cont.activate(own.actuators['walk'])
989
+    #     #dict['driving_reset'] = False
990
+    #     #print('reseting driving')   
991
+    # if own['walk_jump_timer'] != 0:
992
+    #     own['walk_jump_timer'] = own['walk_jump_timer'] - 1    
993
+    # wts = own['walk_targ_speed'] +1                 
994
+    # if own['requestAction'] == 'reg_walkFast' and own.linearVelocity.x > (wts * -1):
995
+    #     own['requestAction'] = 'reg_walk' 
996
+    # if own['requestAction'] == 'fak_walkFast' and own.linearVelocity.x < wts:
997
+    #     own['requestAction'] = 'fak_walk' 
998
+    # if own['requestAction'] == 'reg_walkFast_nb' and own.linearVelocity.x > (wts * -1):
999
+    #     own['requestAction'] = 'reg_walk_nb' 
1000
+    # if own['requestAction'] == 'fak_walkFast_nb' and own.linearVelocity.x < wts:
1001
+    #     own['requestAction'] = 'fak_walk_nb'   
1261
 
1002
 
1262
 
1003
 
1263
-    if r_ground.triggered:
1264
-        #force2 = [0.0, 0, dict['antibounce']]
1265
-        #own.applyForce(force2, True)
1004
+    # if r_ground.triggered:
1005
+    #     #force2 = [0.0, 0, dict['antibounce']]
1006
+    #     #own.applyForce(force2, True)
1266
 
1007
 
1267
-        gdist = ((own.worldPosition.z - r_ground.hitPosition[2]))  
1268
-        #print(gdist)
1269
-        if gdist < .28 and gdist > .1:
1270
-            #move = 2.875 - gdist
1271
-            move = (.28 - gdist)*.5
1272
-            #move = (own.worldPosition.z + gdist)
1273
-            if move > 0:
1274
-                own.worldPosition.z = own.worldPosition.z + move
1275
-            else:
1276
-                own.worldPosition.z = own.worldPosition.z - move    
1277
-            own.linearVelocity.z = 0        
1008
+    #     gdist = ((own.worldPosition.z - r_ground.hitPosition[2]))  
1009
+    #     #print(gdist)
1010
+    #     if gdist < .28 and gdist > .1:
1011
+    #         #move = 2.875 - gdist
1012
+    #         move = (.28 - gdist)*.5
1013
+    #         #move = (own.worldPosition.z + gdist)
1014
+    #         if move > 0:
1015
+    #             own.worldPosition.z = own.worldPosition.z + move
1016
+    #         else:
1017
+    #             own.worldPosition.z = own.worldPosition.z - move    
1018
+    #         own.linearVelocity.z = 0        
1278
 
1019
 
1279
     
1020
     
1280
-    jump()
1281
-    #dropin()
1282
-    throwdeck_trigger()
1021
+    # jump()
1022
+    # #dropin()
1023
+    # throwdeck_trigger()
1283
 
1024
 
1284
-    nextframe()
1285
-    checkidle()
1025
+    # nextframe()
1026
+    # checkidle()
1286
     
1027
     
1287
-    reset_pos()
1288
-    switchcam()
1289
-    move_flycam()
1290
-    move_followcam()
1291
-    fall()
1292
-    idle_anim()
1293
-    sit()
1294
-    onground()
1295
-    getonboard(dict, cont)
1296
-    onboard() 
1297
-    focus_deck()
1298
-    get_in_car()
1299
-    get_on_bike(dict, own)
1028
+    # reset_pos()
1029
+    # #switchcam()
1030
+    # #move_flycam()
1031
+    # #move_followcam()
1032
+    # fall()
1033
+    # idle_anim()
1034
+    # sit()
1035
+    # onground()
1036
+    # getonboard(dict, cont)
1037
+    # onboard() 
1038
+    # focus_deck()
1039
+    # get_in_car()
1040
+    # get_on_bike(dict, own)
1300
 
1041
 
1301
-    #printplaying() 
1042
+    # #printplaying() 
1302
 
1043
 
1303
-    own.alignAxisToVect([0.0,0.0,1.0], 2, .03)
1304
-    #own.actuators["sroll"].stopSound() 
1305
-    camobj['sndmgr'].stop_sound(['roll'])
1306
-    wheel1 = scene.objects["wheel1"]
1307
-    wheel2 = scene.objects["wheel2"]
1308
-    wheel3 = scene.objects["wheel3"]
1309
-    wheel4 = scene.objects["wheel4"]
1310
-    wheel1.stopAction(2)
1311
-    wheel2.stopAction(2)
1312
-    wheel3.stopAction(2)
1313
-    wheel4.stopAction(2)
1314
-    own['lasty'] = yBut
1315
-    own['lastb'] = bBut  
1316
-    own['lasta'] = aBut
1317
-    own['lastx'] = xBut   
1318
-    own['lastlts'] = ltsBut
1319
-    own['lastrts'] = rtsBut        
1320
-    own['lastbkBut'] = bkBut
1321
-    own['dropinCol'] = dropinCol
1322
-    own['walk'] = 1
1323
-    dict['walk'] = 1
1324
-        
1044
+    # own.alignAxisToVect([0.0,0.0,1.0], 2, .03)
1045
+    # #own.actuators["sroll"].stopSound() 
1046
+    # camobj['sndmgr'].stop_sound(['roll'])
1047
+    # wheel1 = scene.objects["wheel1"]
1048
+    # wheel2 = scene.objects["wheel2"]
1049
+    # wheel3 = scene.objects["wheel3"]
1050
+    # wheel4 = scene.objects["wheel4"]
1051
+    # wheel1.stopAction(2)
1052
+    # wheel2.stopAction(2)
1053
+    # wheel3.stopAction(2)
1054
+    # wheel4.stopAction(2)
1055
+    # own['lasty'] = yBut
1056
+    # own['lastb'] = bBut  
1057
+    # own['lasta'] = aBut
1058
+    # own['lastx'] = xBut   
1059
+    # own['lastlts'] = ltsBut
1060
+    # own['lastrts'] = rtsBut        
1061
+    # own['lastbkBut'] = bkBut
1062
+    # own['dropinCol'] = dropinCol
1063
+    # own['walk'] = 1
1064
+    # dict['walk'] = 1
1065
+    #     

+ 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:509fc1002b193babf9301e78c96b23ab02e9c56f3fba19739b5e4ec4982beda1
3
-size 117092972
2
+oid sha256:990b6a53606aad8b319016525a494c1d4b0188e41fa6619000ad8a44f891dd6a
3
+size 126713928

BIN
shuvit_assets.ods View File


+ 3
- 0
sounds/s_l_1.wav View File

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

+ 3
- 0
sounds/s_l_2.wav View File

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

+ 3
- 0
sounds/s_r_1.wav View File

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

+ 3
- 0
sounds/s_r_2.wav View File

1
+version https://git-lfs.github.com/spec/v1
2
+oid sha256:7f719526cd85d65a6d6390a2a9f1f3693ad706e9af59bf76aa6271835a365e1a
3
+size 70576

+ 3
- 0
sounds/walk_climb.wav View File

1
+version https://git-lfs.github.com/spec/v1
2
+oid sha256:670e826c4bd46f51eb6352fdb8e07e18ee0f106596ed0afa61a63487b01ddefe
3
+size 49584

+ 3
- 0
sounds/walk_grunt.wav View File

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

+ 3
- 0
sounds/walk_hang.wav View File

1
+version https://git-lfs.github.com/spec/v1
2
+oid sha256:57b60a397c288b0c5be62717fa26ac3bc877919bc67b927ecf12e260de966daf
3
+size 456044

+ 3
- 0
sounds/walk_land.wav View File

1
+version https://git-lfs.github.com/spec/v1
2
+oid sha256:113be012923dd1ac23bdb8e17cd345cf8a0acbf77318167a81115def6b6f8995
3
+size 100384

+ 3
- 0
sounds/walkondirt.wav View File

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

Loading…
Cancel
Save