Browse Source

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

weee
shuvit 1 year 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

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

+ 3
- 0
assets/foiliage_b.blend View File

@@ -0,0 +1,3 @@
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,3 +1,3 @@
1 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,3 +1,3 @@
1 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

@@ -0,0 +1,3 @@
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

@@ -0,0 +1,7 @@
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

@@ -0,0 +1,3 @@
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

@@ -0,0 +1,7 @@
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

@@ -0,0 +1,3 @@
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

@@ -0,0 +1,7 @@
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

@@ -0,0 +1,3 @@
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

@@ -0,0 +1,7 @@
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

@@ -0,0 +1,3 @@
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

@@ -0,0 +1,7 @@
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,3 +1,3 @@
1 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

@@ -0,0 +1,3 @@
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

@@ -0,0 +1,3 @@
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

@@ -0,0 +1,3 @@
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

@@ -0,0 +1,3 @@
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

@@ -0,0 +1,3 @@
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

@@ -0,0 +1,3 @@
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

@@ -0,0 +1,3 @@
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

@@ -0,0 +1,3 @@
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

@@ -0,0 +1,3 @@
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

@@ -0,0 +1,3 @@
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

@@ -0,0 +1,3 @@
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

@@ -0,0 +1,3 @@
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

@@ -0,0 +1,3 @@
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

@@ -0,0 +1,3 @@
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

@@ -0,0 +1,3 @@
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

@@ -0,0 +1,3 @@
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

@@ -0,0 +1,3 @@
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

@@ -0,0 +1,3 @@
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

@@ -0,0 +1,3 @@
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

@@ -0,0 +1,3 @@
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

@@ -0,0 +1,3 @@
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

@@ -0,0 +1,3 @@
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

@@ -0,0 +1,3 @@
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

@@ -0,0 +1,3 @@
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

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

+ 3
- 0
assets/ramps.blend View File

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

+ 2
- 2
assets/user2.blend View File

@@ -1,3 +1,3 @@
1 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,3 +1,3 @@
1 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

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

+ 2
- 2
characters/ken.blend View File

@@ -1,3 +1,3 @@
1 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,14 +15,15 @@ profile = 0
15 15
 resx = 1920
16 16
 resy = 1080
17 17
 fullscreen_on = 1
18
-music_player = 0
18
+music_player = 1
19 19
 vsync_on = 0
20 20
 #----------
21 21
 
22 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 29
 #replay recorder
@@ -33,9 +34,9 @@ recorder_on = 1
33 34
 
34 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 40
 cam_max = 4.4
40 41
 cch_targetHeight = 0.3
41 42
 
@@ -54,12 +55,12 @@ character = ken
54 55
 
55 56
 shirt_logo = 2
56 57
 
57
-shirt_color_r = 0.4
58
+shirt_color_r = 1
58 59
 shirt_color_g = 0.03
59 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 64
 shoe_color_b = 0
64 65
 #-----------------
65 66
 
@@ -91,13 +92,13 @@ wheel4_b = 0.21
91 92
 ###################
92 93
 
93 94
 #brightness / contrast
94
-bc = 1
95
+bc = 0
95 96
 BC_BRIGHTNESS = 1.1
96 97
 BC_CONTRAST = 1.09
97 98
 
98 99
 #HDR
99 100
 hdr = 1
100
-avgL = 0.8
101
+avgL = 0.69
101 102
 HDRamount = 0.05
102 103
 
103 104
 #Ambient Occlusion
@@ -107,20 +108,20 @@ aowidth = 0.2
107 108
 aoradius = 2.4
108 109
 
109 110
 #Depth of Field
110
-dof_on = 1
111
+dof_on = 0
111 112
 
112 113
 #Bloom
113 114
 bloom_on = 0
114 115
 
115 116
 #FXAA
116
-fxaa = 1
117
+fxaa = 0
117 118
 FXAA_SPAN_MAX = 8.0
118 119
 #-------------------
119 120
 
120 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 125
 sun_rot_x = -0.05
125 126
 sun_rot_y = -0.05
126 127
 shadow_on = 0
@@ -143,7 +144,7 @@ pump_downforce = -0.0
143 144
 man_sens_l = 0.03
144 145
 man_sens_r = 0.08
145 146
 man_sens_side = 0.035
146
-turn_rotation = 0.0175
147
+turn_rotation = 0.025#0.0175
147 148
 turn_addx = 0.004
148 149
 turn_air_rotation = 0.07
149 150
 grass_mult = 0.98
@@ -152,6 +153,13 @@ antibounce = -10.0
152 153
 gravity = -10.5
153 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 163
 #controller mappings
156 164
 ########
157 165
 lar_lts = 0

+ 46
- 2
scripts/FSM.py View File

@@ -1,5 +1,7 @@
1 1
 import bge
2 2
 
3
+import StatesGame
4
+import StatesPlayer
3 5
 import StatesWalker
4 6
 import StatesCamera
5 7
 import StatesCar
@@ -26,6 +28,7 @@ class FSM(object):
26 28
         self.stateLife = 0
27 29
         self.owner = owner
28 30
         self.name = None
31
+        self.last_state_notes = None
29 32
         
30 33
     def AddTransition(self, transName, transition):
31 34
         self.transitions[transName] = transition
@@ -67,7 +70,12 @@ class GameFSM(Char):
67 70
         self.owner = owner
68 71
         
69 72
         state_list = [
70
-        'Example']
73
+        'Example',
74
+        'Startup',
75
+        'Initer',
76
+        'LoadLevel',
77
+        'GameOn',
78
+        'Reload']
71 79
         
72 80
         for s in state_list:
73 81
             self.FSM.AddState(s, getattr(StatesGame, s)(self.FSM))
@@ -75,7 +83,43 @@ class GameFSM(Char):
75 83
             self.FSM.AddTransition(t, Transition(s))
76 84
         
77 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 124
     def Execute(self):
81 125
         self.FSM.Execute(self.owner)    

+ 11
- 11
scripts/Record.py View File

@@ -325,19 +325,19 @@ def loadData():
325 325
     lengthVis = own["lengthVis"]
326 326
     
327 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 341
     #-----Skater Animation Name-----#
342 342
     own["lengthSkaterAnim"] = readData.getLengthSkaterAnim()
343 343
     lengthSkaterAnim = own["lengthSkaterAnim"]

+ 66
- 18
scripts/Settings.py View File

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

+ 7
- 1
scripts/Startup.py View File

@@ -2,6 +2,7 @@ import bge
2 2
 
3 3
 def main(cont):
4 4
     #cont = bge.logic.getCurrentController() 
5
+    print('Startup.py running ----------')
5 6
     own = cont.owner
6 7
     scenes = bge.logic.getSceneList()
7 8
 
@@ -102,11 +103,16 @@ def main(cont):
102 103
     dict['sunz'] = 1.0 
103 104
     dict['replay_loop_start'] = 0
104 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 107
     dict['rp_keyframes'] = []
107 108
     dict['rp_positions'] = []
108 109
     dict['temp_list'] = []
109 110
     dict['scene_inited'] = True
110 111
     dict['p1c'] = None
112
+    dict['sun_lights'] = []
113
+    dict['ambient_lights'] = []
114
+
115
+    dict['joy_con'] = False
116
+    
111 117
     
112 118
 #main()

+ 124
- 7
scripts/StatesGame.py View File

@@ -1,5 +1,13 @@
1
-import utils
2 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 12
 State = type("State", (object,), {})
5 13
 #====================================     
@@ -15,6 +23,7 @@ class State(object):
15 23
         print('Executing')
16 24
     def Exit(self):
17 25
         print('Exiting')
26
+
18 27
 #==================================== 
19 28
             
20 29
 class Example(State):
@@ -27,12 +36,120 @@ class Example(State):
27 36
         
28 37
     def Execute(self):
29 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 152
     def Exit(self):
36 153
         pass
37 154
 
38
-#====================================  
155
+#==================================== 

+ 805
- 0
scripts/StatesPlayer.py View File

@@ -0,0 +1,805 @@
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,7 +175,7 @@ state_b = ['reg_jump',
175 175
 'fak_jump',
176 176
 'fak_walk_air',
177 177
 'fak_walk_air_out',
178
-#'fak_onboard',
178
+'fak_onboard',
179 179
 #'fak_offboard',
180 180
 'fak_brfoot',
181 181
 'fak_frfoot',
@@ -278,212 +278,216 @@ def check_land(rA, aState, own):
278 278
 	return aState	
279 279
 
280 280
 def main(cont):
281
-	own = cont.owner
282 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 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 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 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 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 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 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,23 +191,25 @@ reg_idle7 = a_class(
191 191
 
192 192
 reg_jump = a_class(
193 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 196
 	#deck action name, start, end frames  
196
-	'b_reg_jump', 1, 10,
197
+	'b_reg_jump', 1, 5,
197 198
 	#layer, speed, mode (0 = play, 1 = loop), blendin
198
-	1, .5, 0, 10,
199
+	3, .75, 0, 5,
199 200
 	#intro, length
200 201
 	None, 0,
201 202
 	#exits
202 203
 	['reg_idle', 'reg_walk_air', 'reg_onboard'],
203 204
 	#force exit, frame
204
-	'reg_walk_air', 20,
205
+	'reg_walk_air', 12,
205 206
 	#opposite
206 207
 	None)
207 208
 
208 209
 reg_walk_air = a_class(
209 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 213
 	#deck action name, start, end frames  
212 214
 	'b_reg_walk_air', 10, 10,
213 215
 	#layer, speed, mode (0 = play, 1 = loop), blendin
@@ -225,7 +227,8 @@ reg_walk_air = a_class(
225 227
 
226 228
 reg_walk_air_out = a_class(
227 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 232
 	#deck action name, start, end frames  
230 233
 	'b_reg_walk_air', 10, 40,
231 234
 	#layer, speed, mode (0 = play, 1 = loop), blendin
@@ -236,7 +239,7 @@ reg_walk_air_out = a_class(
236 239
 	#['reg_idle', 'reg_walk', 'reg_walkFast', 'reg_onboard'],
237 240
 	walk_exits,
238 241
 	#force exit, frame
239
-	'reg_idle', 10,
242
+	'reg_idle', 20,
240 243
 	#opposite
241 244
 	None)
242 245
 
@@ -317,7 +320,7 @@ reg_roll = a_class(
317 320
 	#intro, length
318 321
 	None, 0,
319 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 324
 	#force exit, frame
322 325
 	None, 0,
323 326
 	#opposite
@@ -2528,17 +2531,18 @@ fak_onboard = a_class(
2528 2531
 
2529 2532
 fak_offboard = a_class(
2530 2533
 	#player armature action name, start, end frames
2531
-	'fak_noffboard', 1, 30,
2534
+	'fak_noffboard', 1, 24,
2535
+	#'fak_noffboard', 
2532 2536
 	#deck action name, start, end frames  
2533
-	'b_fak_offboard', 1, 30,
2537
+	'b_reg_offboard', 1, 30,
2534 2538
 	#layer, speed, mode (0 = play, 1 = loop), blendin
2535
-	4, .5, 0, 5,
2539
+	2, .5, 0, 0,
2536 2540
 	#intro, length
2537 2541
 	None, 0,
2538 2542
 	#exits
2539
-	['fak_idle', 'fak_walkFast', 'fak_walk', 'fak_onboard'],
2543
+	['reg_idle', 'fak_idle', 'fak_walkFast', 'fak_walk', 'fak_onboard'],
2540 2544
 	#force exit, frame
2541
-	'fak_idle', 28,
2545
+	'reg_idle', 24,
2542 2546
 	#opposite
2543 2547
 	None)
2544 2548
 
@@ -2552,12 +2556,13 @@ fak_roll = a_class(
2552 2556
 	#intro, length
2553 2557
 	None, 0,
2554 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 2560
 	#force exit, frame
2557 2561
 	None, 0,
2558 2562
 	#opposite
2559 2563
 	'reg_roll')
2560 2564
 
2565
+#not working
2561 2566
 fak_turnLeft = a_class(
2562 2567
 	#player armature action name, start, end frames
2563 2568
 	'nfak_left', 10, 30,
@@ -2568,7 +2573,7 @@ fak_turnLeft = a_class(
2568 2573
 	#intro, length
2569 2574
 	None, 0,
2570 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 2577
 	#force exit, frame
2573 2578
 	None, 0,
2574 2579
 	#opposite
@@ -2584,7 +2589,7 @@ fak_turnRight = a_class(
2584 2589
 	#intro, length
2585 2590
 	None, 0,
2586 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 2593
 	#force exit, frame
2589 2594
 	None, 0,
2590 2595
 	#opposite
@@ -3837,7 +3842,7 @@ fak_bsboard_in = a_class(
3837 3842
 	#player armature action name, start, end frames
3838 3843
 	'fak_BS_Board2', 1, 40,
3839 3844
 	#deck action name, start, end frames  
3840
-	'b_reg', 1, 40,
3845
+	'b_fak_bsboard', 1, 40,
3841 3846
 	#layer, speed, mode (0 = play, 1 = loop), blendin
3842 3847
 	1, 1, 0, 10,
3843 3848
 	#intro, length
@@ -3853,7 +3858,7 @@ fak_bsboard = a_class(
3853 3858
 	#player armature action name, start, end frames
3854 3859
 	'fak_BS_Board2', 41, 80,
3855 3860
 	#deck action name, start, end frames  
3856
-	'b_reg', 1, 1,
3861
+	'b_fak_bsboard', 1, 40,
3857 3862
 	#layer, speed, mode (0 = play, 1 = loop), blendin
3858 3863
 	1, .5, 1, 15,
3859 3864
 	#intro, length
@@ -3869,7 +3874,7 @@ fak_fsboard_in = a_class(
3869 3874
 	#player armature action name, start, end frames
3870 3875
 	'fak_FS_Board2', 1, 40,
3871 3876
 	#deck action name, start, end frames  
3872
-	'b_reg', 1, 40,
3877
+	'b_fak_bsboard', 1, 40,
3873 3878
 	#layer, speed, mode (0 = play, 1 = loop), blendin
3874 3879
 	1, 1, 0, 10,
3875 3880
 	#intro, length

+ 15
- 3
scripts/boneRecord.py View File

@@ -4,20 +4,21 @@ from mathutils import Vector
4 4
 dict = bge.logic.globalDict
5 5
 dict['replay_record_length']
6 6
 
7
-bone_list = ["foot.ik.R", "foot.ik.L", "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 10
 deck_list = ['main', 'turn']
10 11
 
11 12
 #bone_list = ['root', 'head']
12 13
 
13
-def Record():    
14
+def Record():   
15
+    #print('bone recording') 
14 16
     scene = bge.logic.getCurrentScene()
15 17
     #own = cont.owner
16 18
     master = scene.objects['control_cube.002']
17 19
     cam = scene.objects['Camera.003']
18 20
     armature = scene.objects['Char4']
19 21
     deck = scene.objects['deck_arm']
20
-    #print('bone recording')
21 22
     if 'dataList' not in master:
22 23
         for x in bone_list:
23 24
             master['dataList'] = True
@@ -49,6 +50,17 @@ def Record():
49 50
         master[str(y) + '-pos'].append(pos)
50 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 66
     for y in deck_list:

+ 3
- 4
scripts/camera.py View File

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

+ 30
- 11
scripts/controller2.py View File

@@ -611,6 +611,7 @@ def main():
611 611
             if LAST_LEFT_FAK == 0 or (playing_action_frame > (LAND_END - 2) and playing_action_frame < (LAND_END - 1)):
612 612
                 LAST_LEFT_FAK = 1
613 613
             own["LAST_LEFT_FAK"] = 1
614
+
614 615
     def fak_stance_left_off():
615 616
         LAST_LEFT_FAK = own["LAST_LEFT_FAK"]
616 617
         own["LAST_LEFT_FAK"] = 0
@@ -623,6 +624,7 @@ def main():
623 624
                 own['requestAction'] = 'fak_turnRight'
624 625
             LAST_RIGHT_FAK = own["LAST_RIGHT_FAK"]
625 626
             own["LAST_RIGHT_FAK"] = 1
627
+
626 628
     def fak_stance_right_off():
627 629
         LAST_RIGHT_FAK = own["LAST_RIGHT_FAK"]
628 630
         own["LAST_RIGHT_FAK"] = 0
@@ -1652,7 +1654,9 @@ def main():
1652 1654
 
1653 1655
         if d2 > .3 and own['airup'] == 1 and localRay_v[0] == None:
1654 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 1660
         if d2 > .3 and own['airup'] == 0 and localRay_v[0] == None:
1657 1661
 
1658 1662
             distance = own.getDistanceTo(gray.hitPosition)
@@ -3385,13 +3389,19 @@ def main():
3385 3389
                     pass
3386 3390
 
3387 3391
     def getoffboard():
3388
-        lasty = own['lasty']
3392
+        #lasty = own['lasty']
3393
+        lasty = dict['last_yBut']
3389 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 3401
             own['getoffboard'] = 1
3394 3402
 
3403
+
3404
+
3395 3405
     def switchcam():
3396 3406
         pass
3397 3407
     #    if ltsBut == False and own['lastlts'] == True and rtsBut == False:
@@ -3945,6 +3955,8 @@ def main():
3945 3955
 
3946 3956
     def wallride_sound():
3947 3957
         sact = own.actuators["wallSound"]
3958
+        # if 'aState' not in own:
3959
+        #     own['aState'] = ''
3948 3960
         if  own['aState'] in ['reg_wall_r', 'reg_wall_l', 'fak_wall_r', 'fak_wall_l'] and not skater.isPlayingAction(3):
3949 3961
             sact.volume = .2
3950 3962
             cont.activate(own.actuators["wallSound"])
@@ -4257,14 +4269,17 @@ def main():
4257 4269
             own.alignAxisToVect([0.0, 0.0, 1.0], 2, .05)  
4258 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 4271
             own['vert'] = 1
4260
-            print('vert hit')
4272
+            #print('vert hit')
4261 4273
             ud_sens = .04      
4262 4274
             if 'spine' in localRay_v[0] and lUD < -.04:
4263 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 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 4284
             elif lUD > -ud_sens: 
4270 4285
                 own['last_vert_frame'] = own['framenum']
@@ -4277,11 +4292,14 @@ def main():
4277 4292
                         own.localLinearVelocity.z = 0
4278 4293
                     own.applyMovement((0, 0, (.295 - (localHitDist))), True)
4279 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 4297
                         aligned = True
4298
+                # elif localHitDist > .4 and localHitDist < 1.5:
4299
+                #     own.applyMovement((0, 0, (.295 - (localHitDist))), True)
4282 4300
             else:
4283 4301
                 own.alignAxisToVect([0,0,1], 2, .1)
4284
-                print('doing nothing')            
4302
+                #print('doing nothing')            
4285 4303
 
4286 4304
     localHitDist = 1000
4287 4305
     raytof = scene.objects['rayTo_f']
@@ -4319,3 +4337,4 @@ def main():
4319 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 4338
         own['requestAction'] = 'fak_land'   
4321 4339
 
4340
+    #print(own['getonboard'], 'controller geton', '--controller running')

+ 37
- 0
scripts/game.py View File

@@ -0,0 +1,37 @@
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,7 +129,8 @@ def main():
129 129
 
130 130
         lineVector = secondary - primary
131 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 135
         eul = Vector((1, 0, 0)).rotation_difference(lineVector).to_euler()        
135 136
         
@@ -139,17 +140,11 @@ def main():
139 140
         rotation = te.worldOrientation.to_euler()
140 141
         if abs(rotation.z) > 3:
141 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 144
         xyz = te.localOrientation.to_euler()
147 145
         xyz[0] = math.radians(0)
148 146
         te.localOrientation = xyz.to_matrix()
149 147
 
150
-
151
-
152
-
153 148
         if lineVector == Vector([0.0, 0.0, 0.0]):
154 149
             #print('vector is empty')
155 150
             pass
@@ -157,21 +152,22 @@ def main():
157 152
             te.alignAxisToVect(lineVector, 0, 1)
158 153
         
159 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 != []: