Browse Source

keyframes

shuvit 5 years ago
parent
commit
23fd05f4ef
69 changed files with 896 additions and 433 deletions
  1. 2
    2
      assets/buildings.blend
  2. BIN
      assets/custom_shaders/__pycache__/wind.cpython-36.pyc
  3. 2
    0
      assets/custom_shaders/wind.py
  4. 3
    0
      assets/dlt2.blend
  5. 3
    0
      assets/fire_hydrant.blend
  6. 2
    2
      assets/ground_tiles.blend
  7. 1
    1
      assets/grunge_wall.blend
  8. 3
    0
      assets/kits/base_kit.blend
  9. 3
    0
      assets/legde_b.blend
  10. 2
    2
      assets/lot.blend
  11. 3
    0
      assets/lot2.blend
  12. 2
    2
      assets/manny_pad.blend
  13. 3
    0
      assets/materials/base_m_kit.blend
  14. 3
    0
      assets/materials/builtins/skybox0/__init__.py
  15. 14
    2
      assets/materials/builtins/skybox0/sky.fs
  16. 1
    0
      assets/materials/builtins/skybox0/sky.vs
  17. 2
    2
      assets/mini_island.blend
  18. 2
    2
      assets/ppUrbanFoliage.blend
  19. 2
    2
      assets/ppbld.blend
  20. 3
    0
      assets/semi_trailer.blend
  21. 3
    0
      assets/test.blend
  22. 2
    2
      assets/trees_pine.blend
  23. 2
    2
      assets/user1.blend
  24. 2
    2
      assets/user1.blend1
  25. 0
    3
      assets/user10.blend
  26. 0
    3
      assets/user11.blend
  27. 0
    3
      assets/user12.blend
  28. 2
    2
      assets/user2.blend
  29. 0
    3
      assets/user3.blend
  30. 0
    3
      assets/user4.blend
  31. 0
    3
      assets/user5.blend
  32. 0
    3
      assets/user6.blend
  33. 0
    3
      assets/user7.blend
  34. 0
    3
      assets/user8.blend
  35. 2
    2
      characters/annie.blend
  36. 12
    12
      characters/annie.ini
  37. 39
    37
      config.ini
  38. 3
    0
      npc_walkers/larry.blend
  39. 3
    0
      npc_walkers/larry1.blend
  40. 3
    0
      npc_walkers/larry_loader.blend
  41. 2
    1
      scripts/Manager.py
  42. 1
    1
      scripts/Record.py
  43. 1
    1
      scripts/Settings.py
  44. 5
    1
      scripts/Startup.py
  45. BIN
      scripts/__pycache__/Manager.cpython-36.pyc
  46. BIN
      scripts/__pycache__/Record.cpython-36.pyc
  47. BIN
      scripts/__pycache__/Settings.cpython-36.pyc
  48. BIN
      scripts/__pycache__/Startup.cpython-36.pyc
  49. BIN
      scripts/__pycache__/co_ActionState.cpython-36.pyc
  50. BIN
      scripts/__pycache__/colors.cpython-36.pyc
  51. BIN
      scripts/__pycache__/controller2.cpython-36.pyc
  52. BIN
      scripts/__pycache__/grindV2.cpython-36.pyc
  53. BIN
      scripts/__pycache__/load_char.cpython-36.pyc
  54. BIN
      scripts/__pycache__/menuV3.cpython-36.pyc
  55. BIN
      scripts/__pycache__/scene_init.cpython-36.pyc
  56. BIN
      scripts/__pycache__/walk.cpython-36.pyc
  57. 13
    89
      scripts/controller2.py
  58. 33
    0
      scripts/dynamicLoader.py
  59. 33
    28
      scripts/grindV2.py
  60. 29
    27
      scripts/load_char.py
  61. 22
    12
      scripts/menuV3.py
  62. 2
    0
      scripts/npause.py
  63. 134
    0
      scripts/npause_tmp.py
  64. 135
    166
      scripts/scene_init.py
  65. 4
    2
      scripts/walk.py
  66. 25
    0
      scripts/walker_load.py
  67. 323
    0
      scripts/walker_states.py
  68. 2
    2
      shuvit.blend
  69. 3
    0
      textures/vignette.png

+ 2
- 2
assets/buildings.blend View File

@@ -1,3 +1,3 @@
1 1
 version https://git-lfs.github.com/spec/v1
2
-oid sha256:4a2bc3b1265e7a6e573e1110e56921040c3672af984b5e3737dc42a8a0839404
3
-size 4268444
2
+oid sha256:f43c0bb9a8c03f07c19800c8a2a4337b7467dc5c6832bdfe625f2b3d0980c667
3
+size 4289468

BIN
assets/custom_shaders/__pycache__/wind.cpython-36.pyc View File


+ 2
- 0
assets/custom_shaders/wind.py View File

@@ -1,6 +1,8 @@
1 1
 import os
2 2
 import sys
3 3
 
4
+#shader_components.Wind
5
+
4 6
 from bge import logic
5 7
 
6 8
 from . import custom_shader_base

+ 3
- 0
assets/dlt2.blend View File

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

+ 3
- 0
assets/fire_hydrant.blend View File

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

+ 2
- 2
assets/ground_tiles.blend View File

@@ -1,3 +1,3 @@
1 1
 version https://git-lfs.github.com/spec/v1
2
-oid sha256:9a2e2a33d6ac41ce916e90fb32558ccd8731ba489fbdb8d09ca0d0451cca5914
3
-size 244357568
2
+oid sha256:ad004a37b47996e6a3066b47b79c3c9473034ba55c423262983a14c7876c16f0
3
+size 244779648

+ 1
- 1
assets/grunge_wall.blend View File

@@ -1,3 +1,3 @@
1 1
 version https://git-lfs.github.com/spec/v1
2
-oid sha256:0a8de71602b83655a255c6f6bea738ff2e37c5606c4ebf5f3c796a291f602498
2
+oid sha256:01e157a384b4736e15868650e616754bf3aecd731bea49eaa8c890915d959658
3 3
 size 24078236

+ 3
- 0
assets/kits/base_kit.blend View File

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

+ 3
- 0
assets/legde_b.blend View File

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

+ 2
- 2
assets/lot.blend View File

@@ -1,3 +1,3 @@
1 1
 version https://git-lfs.github.com/spec/v1
2
-oid sha256:73bd8bfdb24ae22fe73f84701d07b3ffb522ac70117fba245727ec5c2f70d196
3
-size 17534196
2
+oid sha256:17e1ac8fb2cd02856193b0653ff269dda7e7d5bdaefc9fbe20e1853703588861
3
+size 17609292

+ 3
- 0
assets/lot2.blend View File

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

+ 2
- 2
assets/manny_pad.blend View File

@@ -1,3 +1,3 @@
1 1
 version https://git-lfs.github.com/spec/v1
2
-oid sha256:3e9ef93be5c934af075dea795f92295a13b0d12896a5fab1a8da9dfa747b3422
3
-size 16278492
2
+oid sha256:49fbd5d3312b9a6194e96a7f981e1af87e172b9cd3a63cb49bab27d7d3618c9e
3
+size 9898104

+ 3
- 0
assets/materials/base_m_kit.blend View File

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

+ 3
- 0
assets/materials/builtins/skybox0/__init__.py View File

@@ -16,6 +16,8 @@ class Skybox(ShaderMaterial):
16 16
         self.sunx = 0.0
17 17
         self.suny = 0.0
18 18
         self.sunz = 0.0
19
+        self.luminance = 1.0 #1.180
20
+        
19 21
 
20 22
     def pre_draw(self, shader):
21 23
         dict = bge.logic.globalDict
@@ -31,6 +33,7 @@ class Skybox(ShaderMaterial):
31 33
         shader.setUniform1f('sunx', self.sunx)
32 34
         shader.setUniform1f('suny', self.suny)
33 35
         shader.setUniform1f('sunz', self.sunz)
36
+        shader.setUniform1f('luminance', self.luminance)
34 37
         #shader.setUniform1f('luminance', bge.logic.luminance)
35 38
         #shader.setUniform1f('bias', bge.logic.bias)
36 39
         #shader.setUniform1f('contrast', bge.logic.contrast)

+ 14
- 2
assets/materials/builtins/skybox0/sky.fs View File

@@ -2,10 +2,20 @@ uniform sampler2D skySampler;
2 2
 
3 3
 varying vec4 fragPos; //fragment coordinates
4 4
 varying vec3 wT, wB, wN; //tangent binormal normal
5
-varying vec3 wPos, pos, viewPos, sunPos;
5
+//varying vec3 wPos, pos, viewPos, sunPos;
6
+varying vec3 wPos, pos, viewPos;
6 7
 uniform vec3 cameraPos;
7 8
 uniform float bias, lumamount, contrast;
8
-varying float luminance;
9
+//varying float luminance;
10
+
11
+uniform float luminance;
12
+
13
+uniform float sunx;
14
+uniform float suny;
15
+uniform float sunz;
16
+
17
+vec3 sunPos = vec3(sunx, suny, sunz);
18
+//vec3 sunPos = (sunx,suny,sunz);
9 19
 
10 20
 vec3 sunDirection = normalize(sunPos);
11 21
 
@@ -80,6 +90,8 @@ float hgPhase(float cosTheta, float g)
80 90
 float sunIntensity(float zenithAngleCos)
81 91
 {
82 92
 	return EE * max(0.0, 1.0 - exp(-((cutoffAngle - acos(zenithAngleCos))/steepness)));
93
+	//return (EE * max(0.0, 1.0 - exp(-((cutoffAngle - acos(zenithAngleCos))/steepness))))*.001;
94
+	//return 5;
83 95
 }
84 96
 
85 97
 float logLuminance(vec3 c)

+ 1
- 0
assets/materials/builtins/skybox0/sky.vs View File

@@ -43,6 +43,7 @@ void main()
43 43
     viewPos = wPos - cameraPos.xyz;
44 44
     //sunPos = m3(ModelMatrix)*vec3(gl_ModelViewMatrixInverse*gl_LightSource[0].position);
45 45
     sunPos = vec3(sunx, suny, sunz);
46
+    //luminance = 10000.000003
46 47
     luminance = gl_Color.r;
47 48
     gl_Position = ftransform();
48 49
 }

+ 2
- 2
assets/mini_island.blend View File

@@ -1,3 +1,3 @@
1 1
 version https://git-lfs.github.com/spec/v1
2
-oid sha256:9442ac2acf03e4a9d82759aaec72bb3eff2553bce69ef6aa7b17e0cf944f9063
3
-size 40017556
2
+oid sha256:c3d90c1a86a0e292498f14c8fc961b5df8fca946620afca9ca7f9a5b40470a9b
3
+size 39460788

+ 2
- 2
assets/ppUrbanFoliage.blend View File

@@ -1,3 +1,3 @@
1 1
 version https://git-lfs.github.com/spec/v1
2
-oid sha256:926ecbe2278edcf6ed6d8eda2898a2e21a93098a7d43506801831c942b14ccea
3
-size 43058620
2
+oid sha256:319826994742cf80200ea0ca95663d7224fa226a2e0e020fff87adede70230a4
3
+size 43059804

+ 2
- 2
assets/ppbld.blend View File

@@ -1,3 +1,3 @@
1 1
 version https://git-lfs.github.com/spec/v1
2
-oid sha256:8d5442ebb7953575d423c4382f6deaf0a280a5b148eeff6203f6978379755a7c
3
-size 47017612
2
+oid sha256:465882844e0d746676538e6d7ceb622d418fe673724132011817f7875b548702
3
+size 46980680

+ 3
- 0
assets/semi_trailer.blend View File

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

+ 3
- 0
assets/test.blend View File

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

+ 2
- 2
assets/trees_pine.blend View File

@@ -1,3 +1,3 @@
1 1
 version https://git-lfs.github.com/spec/v1
2
-oid sha256:9310259c32d38fe1e7fe5c2e753474a46385e2589807414ccbb6c9c502e85ac2
3
-size 36185972
2
+oid sha256:da39fcded16904eeb3427cf30feeb9dcb6f87d5e45fca4c7f5e999a41465687f
3
+size 36121736

+ 2
- 2
assets/user1.blend View File

@@ -1,3 +1,3 @@
1 1
 version https://git-lfs.github.com/spec/v1
2
-oid sha256:ac165edb7ce95ce49d6366e08693815c1455fe08591a5499b90b0a2f683c70c9
3
-size 2449700
2
+oid sha256:48f3197fc6658c31a60f740ec5d9608a40574a606b466ce48906761e18dd01fd
3
+size 1858156

+ 2
- 2
assets/user1.blend1 View File

@@ -1,3 +1,3 @@
1 1
 version https://git-lfs.github.com/spec/v1
2
-oid sha256:d2023b474f2cab2919049873e28728001572b808df806fd60826283f5df59980
3
-size 2449700
2
+oid sha256:3dd6f036660f74af3ddd2238de4887f21a6a8ec48c9f037d155a15a8610f8d68
3
+size 1894700

+ 0
- 3
assets/user10.blend View File

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

+ 0
- 3
assets/user11.blend View File

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

+ 0
- 3
assets/user12.blend View File

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

+ 2
- 2
assets/user2.blend View File

@@ -1,3 +1,3 @@
1 1
 version https://git-lfs.github.com/spec/v1
2
-oid sha256:15c9fd3f50f8392246ac6af75bf25f976c632bcccc7ba657e7c07ec4bbf8aae1
3
-size 36473068
2
+oid sha256:2236921166ae3004513b314a3e66bda97dbcb9a45c94fc7184773c363b3207f3
3
+size 992868

+ 0
- 3
assets/user3.blend View File

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

+ 0
- 3
assets/user4.blend View File

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

+ 0
- 3
assets/user5.blend View File

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

+ 0
- 3
assets/user6.blend View File

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

+ 0
- 3
assets/user7.blend View File

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

+ 0
- 3
assets/user8.blend View File

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

+ 2
- 2
characters/annie.blend View File

@@ -1,3 +1,3 @@
1 1
 version https://git-lfs.github.com/spec/v1
2
-oid sha256:e99508665078153c4fef77c8bc194a116193619a6f3cd78713f3a0e291dda88b
3
-size 23468904
2
+oid sha256:6120cab7a0209e6dd566129a652626ba424846ed9740da9b12120d1874c00619
3
+size 3981620

+ 12
- 12
characters/annie.ini View File

@@ -4,9 +4,9 @@
4 4
 
5 5
 shirt_logo = 5
6 6
 
7
-shirt_color_r = 0
8
-shirt_color_g = 0.16
9
-shirt_color_b = 0
7
+shirt_color_r = 0.21
8
+shirt_color_g = 0.13
9
+shirt_color_b = 0.26
10 10
 
11 11
 shoe_color_r = 0.08
12 12
 shoe_color_g = 0.05
@@ -15,24 +15,24 @@ shoe_color_b = 0.02
15 15
 
16 16
 #deck settings
17 17
 ##############
18
-deck_index = 7
19
-deck_color_r = 0.28
20
-deck_color_g = 0.1
21
-deck_color_b = 0
18
+deck_index = 2
19
+deck_color_r = 1
20
+deck_color_g = 1.0
21
+deck_color_b = 1
22 22
 trucks_r = 0
23
-trucks_g = 0.41
23
+trucks_g = 0
24 24
 trucks_b = 0
25 25
 
26
-wheel1_r = 0.31
26
+wheel1_r = 0.83
27 27
 wheel1_g = 0.16
28 28
 wheel1_b = 0
29
-wheel2_r = 0.31
29
+wheel2_r = 0.83
30 30
 wheel2_g = 0.16
31 31
 wheel2_b = 0
32
-wheel3_r = 0.31
32
+wheel3_r = 0.83
33 33
 wheel3_g = 0.16
34 34
 wheel3_b = 0
35
-wheel4_r = 0.31
35
+wheel4_r = 0.83
36 36
 wheel4_g = 0.16
37 37
 wheel4_b = 0
38 38
 #-------------------

+ 39
- 37
config.ini View File

@@ -20,7 +20,8 @@ music_player = 1
20 20
 
21 21
 #level
22 22
 ######
23
-level = user1
23
+level = user2
24
+levelBlend = user2
24 25
 #------------
25 26
 
26 27
 #replay recorder
@@ -48,41 +49,41 @@ walk_focal_length = 14
48 49
 #character settings
49 50
 ###################
50 51
 
51
-character = annie
52
+character = ralph
52 53
 
53
-shirt_logo = 5
54
+shirt_logo = 4
54 55
 
55
-shirt_color_r = 0
56
-shirt_color_g = 0.16
57
-shirt_color_b = 0
56
+shirt_color_r = 0.54
57
+shirt_color_g = 0.4
58
+shirt_color_b = 0.05
58 59
 
59
-shoe_color_r = 0.08
60
-shoe_color_g = 0.05
60
+shoe_color_r = 0.02
61
+shoe_color_g = 0.02
61 62
 shoe_color_b = 0.02
62 63
 #-----------------
63 64
 
64 65
 #deck settings
65 66
 ##############
66 67
 deck_index = 7
67
-deck_color_r = 0.28
68
-deck_color_g = 0.1
69
-deck_color_b = 0
70
-trucks_r = 0
71
-trucks_g = 0.41
72
-trucks_b = 0
73
-
74
-wheel1_r = 0.31
75
-wheel1_g = 0.16
76
-wheel1_b = 0
77
-wheel2_r = 0.31
78
-wheel2_g = 0.16
79
-wheel2_b = 0
80
-wheel3_r = 0.31
81
-wheel3_g = 0.16
82
-wheel3_b = 0
83
-wheel4_r = 0.31
84
-wheel4_g = 0.16
85
-wheel4_b = 0
68
+deck_color_r = 1
69
+deck_color_g = 1.0
70
+deck_color_b = 1
71
+trucks_r = 0.46
72
+trucks_g = 0.03
73
+trucks_b = 0.03
74
+
75
+wheel1_r = 1
76
+wheel1_g = 0.71
77
+wheel1_b = 0.08
78
+wheel2_r = 1
79
+wheel2_g = 0.71
80
+wheel2_b = 0.08
81
+wheel3_r = 1
82
+wheel3_g = 0.71
83
+wheel3_b = 0.08
84
+wheel4_r = 1
85
+wheel4_g = 0.71
86
+wheel4_b = 0.08
86 87
 #-------------------
87 88
 
88 89
 #2d filter settings
@@ -90,19 +91,19 @@ wheel4_b = 0
90 91
 
91 92
 #brightness / contrast
92 93
 bc = 1
93
-BC_BRIGHTNESS = 1.05
94
-BC_CONTRAST = 1.05
94
+BC_BRIGHTNESS = 1.01
95
+BC_CONTRAST = 1.03
95 96
 
96 97
 #HDR
97 98
 hdr = 1
98
-avgL = 0.55
99
-HDRamount = 0.05
99
+avgL = 0.56
100
+HDRamount = 0.01
100 101
 
101 102
 #Ambient Occlusion
102 103
 ao = 1
103 104
 onlyAO = 0
104
-aowidth = 1.0
105
-aoradius = 16
105
+aowidth = 23.0
106
+aoradius = 96.0
106 107
 
107 108
 #Depth of Field
108 109
 dof_on = 1
@@ -117,16 +118,16 @@ FXAA_SPAN_MAX = 8.0
117 118
 
118 119
 #sun settings
119 120
 #############
120
-sun_strength = 1.05
121
-ambient_strength = 0.5
122
-sun_rot_x = 0.05
121
+sun_strength = 1.0
122
+ambient_strength = 0.68
123
+sun_rot_x = -0.05
123 124
 sun_rot_y = -0.05
124 125
 shadow_on = 0
125 126
 #------------
126 127
 
127 128
 #physics
128 129
 ########
129
-JUMPHEIGHT = 800
130
+JUMPHEIGHT = 840#800
130 131
 MAX_VEL = 6.7
131 132
 SPEEDUP = 0.055
132 133
 SPEEDPUMP = 0.14#.09
@@ -148,3 +149,4 @@ grass_mult = 0.98
148 149
 ylimit = 0.84
149 150
 antibounce = -10.0
150 151
 gravity = -10.5
152
+fall_height = .4

+ 3
- 0
npc_walkers/larry.blend View File

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

+ 3
- 0
npc_walkers/larry1.blend View File

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

+ 3
- 0
npc_walkers/larry_loader.blend View File

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

+ 2
- 1
scripts/Manager.py View File

@@ -739,7 +739,8 @@ def main():
739 739
             dict['rp_positions'] = [] 
740 740
             dict['rp_orientations'] = []
741 741
             freecam['cur_key'] = 0
742
-            freecam.worldOrientation = cam.worldOrientation    
742
+            if dict['npause'] == False:
743
+                freecam.worldOrientation = cam.worldOrientation    
743 744
         valueIndex = own['valueIndex']
744 745
         n = (valueIndex / recording_cutoff) * 1000
745 746
         n = int(round(n))

+ 1
- 1
scripts/Record.py View File

@@ -238,7 +238,7 @@ def loadData():
238 238
     #-----Position-----#
239 239
     own["lengthPos"] = readData.getLengthPos()
240 240
     dict['replay_loop_end'] = own['lengthPos']
241
-    print('setting replay end', dict['replay_loop_end'])
241
+    #print('setting replay end', dict['replay_loop_end'])
242 242
     lengthPos = own["lengthPos"] 
243 243
     
244 244
     if lengthPos:

+ 1
- 1
scripts/Settings.py View File

@@ -111,7 +111,7 @@ def loadlevel():
111 111
     own2 = cont.owner
112 112
 
113 113
     dict = bge.logic.globalDict #Get the global dictionary
114
-    
114
+    dict['scene_inited'] = False
115 115
     if own["framerate"] == 1:    
116 116
         bge.render.showFramerate(1)
117 117
     if own["profile"] ==1:    

+ 5
- 1
scripts/Startup.py View File

@@ -109,6 +109,10 @@ def main():
109 109
     dict['sunz'] = 1.0 
110 110
     dict['replay_loop_start'] = 0
111 111
     dict['replay_loop_end'] = 0
112
-    dict['replay_record_length'] = 7300
112
+    dict['replay_record_length'] = 2400 #7300
113
+    dict['rp_keyframes'] = []
114
+    dict['rp_positions'] = []
115
+    dict['temp_list'] = []
116
+    dict['scene_inited'] = True
113 117
     
114 118
 main()

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


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


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


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


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


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


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


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


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


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


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


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


+ 13
- 89
scripts/controller2.py View File

@@ -2,7 +2,6 @@
2 2
 
3 3
 # control script
4 4
     
5
-
6 5
 import bge
7 6
 import GameLogic
8 7
 import ctypes
@@ -11,35 +10,7 @@ from sys import platform
11 10
 from mathutils import Vector
12 11
     
13 12
 def main():
14
-    #scale = .3
15
-    #action layers
16
-    #0-14 rolling
17
-    #fliplay = 500
18
-    #grindlay = 700
19
-#    os = 'Windows'
20
-#    
21
-#    if platform != "win32":
22
-#     os = 'Linux'
23
-#    def onWindows():
24
-#     return os == 'Windows'
25
-    
26
-
27
-
28 13
     scene = bge.logic.getCurrentScene()
29
-    try:
30
-        GameLogic.DictObjects
31
-        init=1
32
-    except:
33
-        init=0
34
-#    if init:
35
-#        cont.GameLogic.getCurrentController()
36
-#        own = cont.getOwner()
37
-#        name = own.getName()
38
-#        if not GameLogic.DictObjects.has_key(name):
39
-#            GameLogic.DictObjects[name]=cont
40
-#        own.init=0
41
-    #reduction = 400000
42
-    #axisTh = 0.03 
43 14
 
44 15
     #initialize quadrant variables
45 16
     q1on = 0
@@ -311,15 +282,18 @@ def main():
311 282
 
312 283
     def check_fall():
313 284
         playing_frame = 20
285
+        #hitDistance = own.worldPosition.z - r_ground.hitPosition.z
314 286
         if skater.isPlayingAction(fliplay):
315 287
             playing_frame = skater.getActionFrame(fliplay)
316 288
         if r_ground.triggered == True and skater.isPlayingAction(fliplay) and own['jump_timer'] < 40 and playing_frame < 14 and playing_frame > 3:
317
-            own['fall'] = 1
318
-            own['last_fall_frame'] = frame
319
-            if STANCE == 0:
320
-                own['requestAction'] = 'reg_air-walk_air'
321
-            if STANCE == 1:             
322
-                own['requestAction'] = 'fak_air-walk_air'
289
+            hitDistance = own.worldPosition[2] - r_ground.hitPosition[2]
290
+            if hitDistance < dict['fall_height']:
291
+                own['fall'] = 1
292
+                own['last_fall_frame'] = frame
293
+                if STANCE == 0:
294
+                    own['requestAction'] = 'reg_air-walk_air'
295
+                if STANCE == 1:             
296
+                    own['requestAction'] = 'fak_air-walk_air'
323 297
     check_fall()
324 298
 
325 299
     def check_landing():
@@ -3482,8 +3456,7 @@ def main():
3482 3456
             if STANCE == False:
3483 3457
                 reg_onefoot_grab_on()        
3484 3458
             else:
3485
-                fak_frigid_grab_on()                    
3486
-                                            
3459
+                fak_frigid_grab_on()                                                               
3487 3460
             
3488 3461
     #kill grabs        
3489 3462
     if lTrig <= 0.02 and GRAB_ON == True and lTrig >= -.02 and rTrig <= .02 and rTrig >= -.2:
@@ -3591,9 +3564,7 @@ def main():
3591 3564
         lgf = own['last_grind_frame']
3592 3565
         frame = own['framenum']
3593 3566
         frames_since_grinding = frame - lgf
3594
-        #ylimit = .84
3595 3567
         ylimit = dict['ylimit']
3596
-        #print(ground_since, 'ground_since')
3597 3568
         if ground_since < 20 and ground_since > 1 and grindHit == 0 and own['jump_timer'] < 40:
3598 3569
             ylimit = ylimit + ((ground_since - 15) * -.005)
3599 3570
             
@@ -3602,8 +3573,6 @@ def main():
3602 3573
             if STANCE == 0:
3603 3574
                 yvel *= -1
3604 3575
             try:    
3605
-                #dist = r_ground.hitObject.worldPosition - own.worldPosition
3606
-                #print('ground dist', dist)
3607 3576
                 if own.linearVelocity.y > .01 or own.linearVelocity.y < -.01:
3608 3577
                     own.applyRotation([0,0,yvel], True)
3609 3578
                 
@@ -3613,10 +3582,6 @@ def main():
3613 3582
                 pass       
3614 3583
         else:    
3615 3584
             if r_ground.triggered and touched == False and grindHit == 0 and frames_since_grinding > 20:    
3616
-            #     linVelocity4 = own.getLinearVelocity(True)
3617
-            #     newy = linVelocity4.y * ylimit   
3618
-            #     force = [linVelocity4.x, newy, linVelocity4.z]
3619
-            #     own.setLinearVelocity(force, True) 
3620 3585
                 yvel = own.linearVelocity.y
3621 3586
                 yvel = yvel *.03
3622 3587
                 if STANCE == 0:
@@ -3626,9 +3591,7 @@ def main():
3626 3591
                         own.applyRotation([0,0,yvel], True)
3627 3592
                     
3628 3593
                 except:
3629
-                    pass 
3630
-
3631
-        #print(ylimit, 'ylimit')       
3594
+                    pass       
3632 3595
 
3633 3596
     def getoffboard():
3634 3597
         lasty = own['lasty']
@@ -3889,7 +3852,6 @@ def main():
3889 3852
     def control_calib():
3890 3853
         #controller calibration test
3891 3854
         scenes = bge.logic.getSceneList()
3892
-
3893 3855
         controller_calib = [scene for scene in scenes if scene.name=="controller_calib"][0]
3894 3856
         cq1 = controller_calib.objects['q1']
3895 3857
         cq2 = controller_calib.objects['q2']
@@ -3944,9 +3906,6 @@ def main():
3944 3906
             cont.deactivate(own.actuators['grindoutRight'])
3945 3907
             cont.deactivate(own.actuators['grindoutLeft'])  
3946 3908
         if (LAST_GRIND == True and jumping == None and sincegrinding > 20 and ground_since > 20) or own['invert_on'] == True and LAST_GRIND == 1:
3947
-
3948
-        #own['grindTouch']      
3949
-
3950 3909
             outloc = 0.022
3951 3910
             bsoutloc = .07
3952 3911
             bsoutvel = .1
@@ -4291,7 +4250,6 @@ def main():
4291 4250
         linvelx = linVelocity.x
4292 4251
         lastx = own["linvelx"]
4293 4252
         if frames_since_ground < 10 and (abs(lastx) - abs(linvelx)) > .5:
4294
-            #print('land boost')
4295 4253
             force = (lastx, linVelocity.y, linVelocity.z )                    
4296 4254
             own.setLinearVelocity(force, True)                 
4297 4255
     
@@ -4315,9 +4273,7 @@ def main():
4315 4273
     air_mover()
4316 4274
     dropinRotate()    
4317 4275
     onboard()   
4318
-    #wallhit() 
4319 4276
     linvelx = own.getLinearVelocity(True)
4320
-    #land_boost()
4321 4277
     own["linvelx"] = linvelx.x
4322 4278
     LAST_STANCE = STANCE
4323 4279
     LAST_STANCE = own["stance"]
@@ -4356,18 +4312,12 @@ def main():
4356 4312
     own["sel"] = bkBut  
4357 4313
 
4358 4314
     if r_ground.triggered and own["jump_timer"] < 20:
4359
-        #if own['rotz'] > .65:
4360
-        #if own['rotz'] > .15: 
4361 4315
         if 1 == 1:    
4362 4316
             force2 = [0.0, 0, dict['antibounce']]
4363
-            #own.applyForce(force2, True)
4364 4317
 
4365 4318
             gdist = ((own.worldPosition.z - r_ground.hitPosition[2]))  
4366
-            #print(gdist)
4367 4319
             if gdist < .2875 and gdist > .1:
4368
-                #move = 2.875 - gdist
4369 4320
                 move = (.2875 - gdist)*.33
4370
-                #move = (own.worldPosition.z + gdist)
4371 4321
                 if move > 0:
4372 4322
                     own.worldPosition.z = own.worldPosition.z + move
4373 4323
                 else:
@@ -4375,55 +4325,29 @@ def main():
4375 4325
                 own.linearVelocity.z = 0
4376 4326
         else:
4377 4327
             gdist = ((own.worldPosition.z - r_ground.hitPosition[2]))  
4378
-            #print(gdist)
4379 4328
             if gdist < .2875 and gdist > .1:
4380
-                #move = 2.875 - gdist
4381
-                #move = (.2875 - gdist)*.33
4382 4329
                 move = (.2875 - gdist)*.4
4383
-                #move = (own.worldPosition.z + gdist)
4384 4330
                 if move > 0:
4385 4331
                     own.worldPosition.z = own.worldPosition.z + move
4386 4332
                 else:
4387 4333
                     own.worldPosition.z = own.worldPosition.z - move    
4388
-                own.linearVelocity.z = 0            
4389
-                
4390
-    
4334
+                own.linearVelocity.z = 0                   
4391 4335
 
4392 4336
     Axis = 2 
4393 4337
     Distance = -10
4394
-    # X axis is zero
4395
-    # Y is 1
4396
-    # Z is 2
4397 4338
     End = own.worldPosition + (own.worldOrientation.col[Axis]*Distance)
4398 4339
     Start = own.worldPosition
4399 4340
     localRay = own.rayCast(End,Start,0,'ground',1,0,0)
4400
-    #print(localRay)
4401 4341
     if localRay[0]:
4402 4342
         localHitDist = (own.worldPosition - localRay[1]).length
4403
-        #print(localHitDist)
4404
-        #print(localRay[2])
4405 4343
         if localHitDist < .287:
4406 4344
             own.localPosition[2] += (.287 - localHitDist)
4407 4345
             if localRay[2] != [0,0,-1] and grindHit == 0:
4408 4346
                 own.alignAxisToVect(localRay[2], 2, .75)
4409
-                #print('moving local')
4410
-
4411
-    # if own['LAST_GRIND'] == False and touched:
4412
-    #     print('touching but not grinding')
4413
-    #     if STANCE == 0:
4414
-    #         own.applyMovement([-.05, 0, .01], True)
4415
-    #     else:
4416
-    #         own.applyMovement([.05, 0, .01], True)    
4417
-    # #rend = bge.render
4418
-    #rend.drawLine(Start, End, [1,0,0,1])
4419
-    #print(own['rotz'])
4420
-
4421 4347
 
4422 4348
     if own.linearVelocity.x > 10:
4423 4349
         own.linearVelocity.x = 10
4424 4350
     if (grindDar == False and r_ground.triggered and own['grindTouch'] == False) or own['jump_timer'] > 40:
4425 4351
         own['grindType'] = ''
4426 4352
     
4427
-    dict['walk'] = 0  
4428
-
4429
-    #print(own["LAST_GRIND"])
4353
+    dict['walk'] = 0  

+ 33
- 0
scripts/dynamicLoader.py View File

@@ -0,0 +1,33 @@
1
+import bge
2
+
3
+def finished_cb(status):
4
+	print("Library (%s) loaded in %.2fms." % (status.libraryName, status.timeTaken))    
5
+
6
+
7
+def main(cont):
8
+	own = cont.owner
9
+	sens = cont.sensors['Collision']
10
+
11
+	if sens.positive:
12
+		mainDir = bge.logic.expandPath("//")
13
+		wLib = mainDir + "assets\\" + own['libName'] 
14
+		print('colliding') 
15
+		to_free = None
16
+
17
+		if own['libName'] not in str(bge.logic.LibList()):
18
+			print(wLib, 'loading')
19
+			#bge.logic.LibLoad(wLib, 'Scene', asynchronous=True).onFinish = finished_cb
20
+			bge.logic.LibLoad(wLib, 'Scene', async=True).onFinish = finished_cb
21
+		else:
22
+			y = bge.logic.LibList()
23
+			for x in y:
24
+				if own['libName'] in x:
25
+					print('unloading', x)
26
+					to_free = x
27
+					#bge.logic.LibFree(x)
28
+		if to_free != None:
29
+			bge.logic.LibFree(to_free)			
30
+				#else:
31
+					#print('cant unload', x, y)	
32
+			#print('not loading', bge.logic.LibList(), wLib)
33
+				

+ 33
- 28
scripts/grindV2.py View File

@@ -513,7 +513,8 @@ def main():
513 513
     if grindDar.positive == False and grindTouch.triggered and grindold == 0 and dropin == 0 and grind_jump == 0 and own["grindoutturn"] == 0 and gt_cd == 0 and manual == 0 and no_grind == 0 and nearestObject != lastObject and own['grindjumpturn'] == 0 and own['gt_cd2'] == 0 and own['air_mover'] == False:
514 514
         #print("touching, no dar")
515 515
         pass
516
-    #print(grindold, "grindold")        
516
+    #print(grindold, "grindold")  
517
+    skipper = 0      
517 518
     if (grindDar.positive or grindTouch.positive) and no_grind == 0:        
518 519
         if grindDar.positive:
519 520
             detectedObjects = grindDar.hitObjectList
@@ -537,40 +538,44 @@ def main():
537 538
         else:
538 539
             own['inverting'] = False
539 540
         grind_dist = .8#.6
541
+        skipper = 0
540 542
         #print(lastobj.worldPosition)
541 543
         if dist < grind_dist and dropin == 0 and manual == 0 and no_grind == 0 and own['grindoutturn'] == 0 and own['manual'] == 0 and own['gt_cd2'] < 40 and invert_on == False and own['air_mover'] == False and no_grind_pull == 0 and own['last_invert'] == False and own['grindjumpturn'] == 0 and grind_jump == 0 and own['airup'] == 0:
542
-            #print('grind')      
543
-            # hitObject, hitPoint, hitNormal = own.rayCast(nearestObject.worldPosition, own.worldPosition, .0, 'grind')
544
-            # if grindold == 0:     
545
-            #     if grindTouch.triggered:
546
-            #         nearpos = nearestObject.worldPosition
547
-            #         if hitNormal != None:
548
-            #             stre = .45
549
-            #             own.alignAxisToVect(hitNormal, 2, stre) 
550
-                        #print("align")                   
551
-                    #own.worldPosition = [nearpos.x, nearpos.y, nearpos.z + .2975]
552
-                    #print('moving world')
553 544
             #print("grinding")
554 545
             grind_height_dif = (own.worldPosition[2] - nearestObject.worldPosition[2]) - .287
555 546
             worldPos = own.worldPosition
556 547
             if grind_height_dif > -.05:#02:
557
-                grindvect(nearestObject)          
558
-                grindrotvel(nearestObject)
559
-                grind(nearestObject)
560
-                grindold = True
561
-                own['grindold_timer'] = 0
562
-                own["grindHit"] = True
563
-                own['grindnew_timer'] += 1
548
+
549
+                if own['grinder_rot'] != None:
550
+                    grot = nearestObject.getAxisVect( [1, 0.0, 0.0]).x
551
+                    dif = (grot - own['grinder_rot'])
552
+                    if dif > .8 or dif < - .8:
553
+                        print('skipping grind, angle is', dif)
554
+                        skipper = 1
555
+                
564 556
                 
565
-                if own['grindnew_timer'] < 1:
566
-                    if grindTouch.triggered:
567
-                        nearpos = nearestObject.worldPosition
568
-                        if hitNormal != None:
569
-                            stre = .15
570
-                            own.alignAxisToVect(hitNormal, 2, stre) 
571
-                            #print("align")                   
572
-                        #own.worldPosition = [nearpos.x, nearpos.y, nearpos.z + .2975]
573
-                        #print('new moving world')                    
557
+                    #print((grot - own['grinder_rot']), 'grinder_rot')
558
+                own['grinder_rot']  = nearestObject.getAxisVect([1,0,0]).x
559
+                if skipper != 1:
560
+
561
+                    grindvect(nearestObject)          
562
+                    grindrotvel(nearestObject)
563
+                    grind(nearestObject)
564
+                    grindold = True
565
+                    own['grindold_timer'] = 0
566
+                    own["grindHit"] = True
567
+                    own['grindnew_timer'] += 1
568
+
569
+
570
+                    if own['grindnew_timer'] < 1:
571
+                        if grindTouch.triggered:
572
+                            nearpos = nearestObject.worldPosition
573
+                            if hitNormal != None:
574
+                                stre = .15
575
+                                own.alignAxisToVect(hitNormal, 2, stre) 
576
+                                #print("align")                   
577
+                            #own.worldPosition = [nearpos.x, nearpos.y, nearpos.z + .2975]
578
+                            #print('new moving world')                    
574 579
 
575 580
     else:
576 581
         #grindold = False 

+ 29
- 27
scripts/load_char.py View File

@@ -26,40 +26,42 @@ def ai(cont):
26 26
 
27 27
 #    # set parent
28 28
 #    armature.setParent( own, compound, ghost) 
29
-    
30
-    print('loading ai') 
29
+	
30
+	print('loading ai') 
31 31
 
32 32
 def main(cont):
33
-    own = cont.owner
34
-    scene = bge.logic.getCurrentScene()
35
-    actu = cont.actuators['start_level']
36
-    dict = bge.logic.globalDict
37
-    mainDir = bge.logic.expandPath("//")
33
+	own = cont.owner
34
+	scene = bge.logic.getCurrentScene()
35
+	#actu = cont.actuators['start_level']
36
+	actu = cont.actuators['sceneInitState']
37
+	dict = bge.logic.globalDict
38
+	mainDir = bge.logic.expandPath("//")
38 39
  #   if dict['char_loaded'] == 0:
39
-    fileName = mainDir + "characters/" + str(dict["character"]) + '.blend'    
40
-    
41
-    path = bge.logic.expandPath(fileName)
42
-    try:
43
-        bge.logic.LibLoad(path, 'Scene')  
44
-    except:
45
-        pass    
46
-    
47
-    fileName = mainDir + "assets/" + 'bmx_player' + '.blend'    
48
-    
49
-    path = bge.logic.expandPath(fileName)
50
-    bge.logic.LibLoad(path, 'Scene')     
51
-    fileName = mainDir + "assets/" + 'prop_bike.blend'    
52
-    
53
-    path = bge.logic.expandPath(fileName)
54
-    bge.logic.LibLoad(path, 'Scene') 
40
+	fileName = mainDir + "characters/" + str(dict["character"]) + '.blend'    
41
+	
42
+	path = bge.logic.expandPath(fileName)
43
+	try:
44
+		bge.logic.LibLoad(path, 'Scene')  
45
+		fileName = mainDir + "assets/" + 'bmx_player' + '.blend'    
46
+
47
+		path = bge.logic.expandPath(fileName)
48
+		bge.logic.LibLoad(path, 'Scene')     
49
+		fileName = mainDir + "assets/" + 'prop_bike.blend'    
50
+
51
+		path = bge.logic.expandPath(fileName)
52
+		bge.logic.LibLoad(path, 'Scene')         
53
+	except:
54
+		pass    
55
+	
56
+
55 57
 #        dict['char_loaded'] = 1
56
-    
57
-    
58
+	
59
+	
58 60
 #    fileName = mainDir + "characters/sun.blend"    
59 61
 #    
60 62
 #    path = bge.logic.expandPath(fileName)
61 63
 #    bge.logic.LibLoad(path, 'Scene')      
62 64
 
63 65
 
64
-    cont.activate(actu)
65
-    
66
+	cont.activate(actu)
67
+	

+ 22
- 12
scripts/menuV3.py View File

@@ -823,9 +823,9 @@ def endpoint(funct, motion, dict, cont):
823 823
     if funct == 'ambient strength':
824 824
         b = cam['ambient_strength']
825 825
         if motion == 'inc':
826
-            b += .05
826
+            b += .025
827 827
         else:
828
-            b -= .05    
828
+            b -= .025    
829 829
         cam['ambient_strength'] = round(b,2)        
830 830
         dict['ambient_strength'] = round(b,2)  
831 831
 
@@ -942,7 +942,8 @@ def endpoint(funct, motion, dict, cont):
942 942
         if motion == 'inc':
943 943
             level = "pats"
944 944
             main_empty["level"] = "pats"
945
-            dict['level'] = level
945
+            dict['levelBlend'] = 'mini_island'
946
+            #dict['level'] = level
946 947
             Settings.writeSettings()
947 948
             Settings.readSettings()
948 949
             #cont.activate(own.actuators['restart']) 
@@ -955,7 +956,8 @@ def endpoint(funct, motion, dict, cont):
955 956
         if motion == 'inc':
956 957
             level = "j_scene"
957 958
             main_empty["level"] = "j_scene"
958
-            dict['level'] = level
959
+            #dict['level'] = level
960
+            dict['levelBlend'] = 'j_scene'
959 961
             Settings.writeSettings()
960 962
             Settings.readSettings()
961 963
             #cont.activate(own.actuators['restart']) 
@@ -968,7 +970,8 @@ def endpoint(funct, motion, dict, cont):
968 970
         if motion == 'inc':
969 971
             level = "lot"
970 972
             main_empty["level"] = "lot"
971
-            dict['level'] = level
973
+            #dict['level'] = level
974
+            dict['levelBlend'] = 'lot2'
972 975
             Settings.writeSettings()
973 976
             Settings.readSettings()
974 977
             #cont.activate(own.actuators['restart']) 
@@ -981,7 +984,8 @@ def endpoint(funct, motion, dict, cont):
981 984
         if motion == 'inc':
982 985
             level = "train"
983 986
             main_empty["level"] = "train"
984
-            dict['level'] = level
987
+            #dict['level'] = level
988
+            dict['levelBlend'] = 'train'
985 989
             Settings.writeSettings()
986 990
             Settings.readSettings()
987 991
             #cont.activate(own.actuators['restart']) 
@@ -994,7 +998,8 @@ def endpoint(funct, motion, dict, cont):
994 998
         if motion == 'inc':
995 999
             level = "spine"
996 1000
             main_empty["level"] = "spine"
997
-            dict['level'] = level
1001
+            #dict['level'] = level
1002
+            dict['levelBlend'] = 'spine'
998 1003
             Settings.writeSettings()
999 1004
             Settings.readSettings()
1000 1005
             #cont.activate(own.actuators['restart']) 
@@ -1007,7 +1012,8 @@ def endpoint(funct, motion, dict, cont):
1007 1012
         if motion == 'inc':
1008 1013
             level = "warehouse"
1009 1014
             main_empty["level"] = "warehouse"
1010
-            dict['level'] = level
1015
+            #dict['level'] = level
1016
+            dict['levelBlend'] = 'warehouse'
1011 1017
             Settings.writeSettings()
1012 1018
             Settings.readSettings()
1013 1019
             #cont.activate(own.actuators['restart']) 
@@ -1020,7 +1026,8 @@ def endpoint(funct, motion, dict, cont):
1020 1026
         if motion == 'inc':
1021 1027
             level = "shop"
1022 1028
             main_empty["level"] = "shop"
1023
-            dict['level'] = level
1029
+            #dict['level'] = level
1030
+            dict['levelBlend'] = 'shop'
1024 1031
             Settings.writeSettings()
1025 1032
             Settings.readSettings()
1026 1033
             #cont.activate(own.actuators['restart']) 
@@ -1033,7 +1040,8 @@ def endpoint(funct, motion, dict, cont):
1033 1040
         if motion == 'inc':
1034 1041
             level = "sc"
1035 1042
             main_empty["level"] = "sc"
1036
-            dict['level'] = level
1043
+            #dict['level'] = level
1044
+            dict['levelBlend'] = 'sc'
1037 1045
             Settings.writeSettings()
1038 1046
             Settings.readSettings()
1039 1047
             #cont.activate(own.actuators['restart']) 
@@ -1046,7 +1054,8 @@ def endpoint(funct, motion, dict, cont):
1046 1054
         if motion == 'inc':
1047 1055
             level = "user1"
1048 1056
             main_empty["level"] = "user1"
1049
-            dict['level'] = level
1057
+            #dict['level'] = level
1058
+            dict['levelBlend'] = 'user1'
1050 1059
             Settings.writeSettings()
1051 1060
             Settings.readSettings()
1052 1061
             #cont.activate(own.actuators['restart']) 
@@ -1059,7 +1068,8 @@ def endpoint(funct, motion, dict, cont):
1059 1068
         if motion == 'inc':
1060 1069
             level = "user2"
1061 1070
             main_empty["level"] = "user2"
1062
-            dict['level'] = level
1071
+            #dict['level'] = level
1072
+            dict['levelBlend'] = 'user2'
1063 1073
             Settings.writeSettings()
1064 1074
             Settings.readSettings()
1065 1075
             #cont.activate(own.actuators['restart']) 

+ 2
- 0
scripts/npause.py View File

@@ -59,6 +59,7 @@ def main():
59 59
     
60 60
     #switch pause state
61 61
     if dict['stBut'] == True and dict['last_stBut'] == False:
62
+        print('starting to pause')
62 63
         if pause_state == 0:
63 64
             pause_state = 1
64 65
         else:
@@ -67,6 +68,7 @@ def main():
67 68
     
68 69
     #enter pause    
69 70
     if pause_state == 1 and last_pause == 0:
71
+        print('pausing')
70 72
         own.suspendDynamics()
71 73
         own['pre_pause_linvel'] = [own['linvelx'], own['linVely'], 0]
72 74
         own.setLinearVelocity([0,0,0],1)  

+ 134
- 0
scripts/npause_tmp.py View File

@@ -0,0 +1,134 @@
1
+import bge
2
+import menuV3
3
+import Settings
4
+
5
+
6
+#replay huds:
7
+#add_hud
8
+#remove_hud (on control_cube)
9
+
10
+def main():
11
+
12
+    cont = bge.logic.getCurrentController()
13
+    scene = bge.logic.getCurrentScene()
14
+    dict = bge.logic.globalDict 
15
+    
16
+    skater = scene.objects["Char4"]
17
+    deck = scene.objects["deck"]
18
+    trucks = scene.objects["trucks"]
19
+    own = scene.objects["control_cube.002"]
20
+    
21
+    camList = scene.cameras
22
+    freecam = camList["freecam"] 
23
+    mcam = camList['Camera.003']   
24
+    
25
+    cube = scene.objects['control_cube.002']
26
+    
27
+    try:
28
+        pause_state = dict['npause']
29
+        last_pause = dict['last_npause']
30
+    except:
31
+        dict['npause'] = 0
32
+        dict['last_npause'] = 0
33
+        pause_state = 0
34
+        last_pause = 0
35
+
36
+
37
+    def printplaying():
38
+        splaying_layers = "S: "
39
+        playing_layers = "D: "
40
+        tplaying_layers = "T: "
41
+        for x in range(1000):
42
+            if skater.isPlayingAction(x):
43
+            #if trucks.isPlayingAction(x):
44
+            #if skater.isPlayingAction(x):                        
45
+                splaying_layers += str(x)
46
+                splaying_layers += " "        
47
+            if deck.isPlayingAction(x):
48
+            #if trucks.isPlayingAction(x):
49
+            #if skater.isPlayingAction(x):                        
50
+                playing_layers += str(x)
51
+                playing_layers += " "
52
+            if trucks.isPlayingAction(x):
53
+            #if trucks.isPlayingAction(x):
54
+            #if skater.isPlayingAction(x):                        
55
+                tplaying_layers += str(x)
56
+                tplaying_layers += " "            
57
+        print(splaying_layers, playing_layers, tplaying_layers)
58
+
59
+    
60
+    #switch pause state
61
+    if dict['stBut'] == True and dict['last_stBut'] == False:
62
+        if pause_state == 0:
63
+            pause_state = 1
64
+        else:
65
+            pause_state = 0    
66
+        dict['npause'] = pause_state
67
+    
68
+    #enter pause    
69
+    if pause_state == 1 and last_pause == 0:
70
+        own.suspendDynamics()
71
+        own['pre_pause_linvel'] = [own['linvelx'], own['linVely'], 0]
72
+        own.setLinearVelocity([0,0,0],1)  
73
+        cont.activate(cont.actuators['empty'])
74
+        if mcam['playback'] == False:
75
+            cont.activate(cont.actuators['add_overlay']) 
76
+        cont.activate(cont.actuators['remove_stance'])  
77
+        cube['camera'] = 2
78
+        cube['camnum'] = 2 
79
+        scene.active_camera = freecam 
80
+        freecam.lens = mcam['focal_length'] 
81
+        freecam.worldPosition = mcam.worldPosition
82
+        freecam.worldOrientation = mcam.worldOrientation                      
83
+
84
+    if pause_state == 1: 
85
+        if mcam['playback'] == False:       
86
+            layer = 2
87
+            if skater.isPlayingAction(layer):
88
+                skater.stopAction(layer)
89
+            if deck.isPlayingAction(layer):    
90
+                deck.stopAction(layer)
91
+            if trucks.isPlayingAction(layer):    
92
+                trucks.stopAction(layer)
93
+            layer = 3
94
+            if skater.isPlayingAction(layer):
95
+                skater.stopAction(layer)
96
+            if deck.isPlayingAction(layer):    
97
+                deck.stopAction(layer)
98
+            if trucks.isPlayingAction(layer):    
99
+                trucks.stopAction(layer)
100
+            layer = 4
101
+            if skater.isPlayingAction(layer):
102
+                skater.stopAction(layer)
103
+            if deck.isPlayingAction(layer):    
104
+                deck.stopAction(layer)
105
+            if trucks.isPlayingAction(layer):    
106
+                trucks.stopAction(layer)
107
+        menuV3.main(cont)                                                    
108
+                
109
+    #exit pause     
110
+    if pause_state == 0 and last_pause == 1:
111
+        Settings.writeSettings()
112
+        Settings.writeChar()
113
+        own.restoreDynamics()
114
+
115
+        if own['walk'] == False:
116
+            cont.activate(cont.actuators['roll'])
117
+        else:
118
+            cont.activate(cont.actuators['walk'])    
119
+        try:
120
+            own.setLinearVelocity(own['pre_pause_linvel'], 1) 
121
+        except:
122
+            pass    
123
+        cont.activate(cont.actuators['remove_overlay'])  
124
+        cont.activate(cont.actuators['add_stance']) 
125
+        
126
+    if pause_state == 1 and dict['rtsBut'] == False and dict['last_rtsBut'] == True:
127
+        scenes = bge.logic.getSceneList()
128
+        if 'pause' in scenes:    
129
+            cont.activate(cont.actuators['remove_overlay']) 
130
+        else:
131
+            cont.activate(cont.actuators['add_overlay'])                                   
132
+    dict['last_npause'] = pause_state
133
+    
134
+main()

+ 135
- 166
scripts/scene_init.py View File

@@ -5,178 +5,147 @@ def main():
5 5
     import bge
6 6
     #import GameLogic
7 7
     cont = bge.logic.getCurrentController()
8
+    scene = bge.logic.getCurrentScene()
8 9
     own = cont.owner
10
+    #own = scene.objects['control_cube.002']
9 11
     dict = bge.logic.globalDict
10
-    #print("nnnnnnpause level", dict['level'])
11
-    own['last_stBut'] = False
12
-    level = dict['level']
13
-    scene = bge.logic.getCurrentScene()
14
-    cam = scene.objects['Camera.003']
15
-    curscene = bge.logic.getCurrentScene()
16
-    
17
-#    scenes = bge.logic.getSceneList()
18
-#    for scene in scenes :
19
-#        if scene.name == 'main':
20
-#            player = scene.objects['player']    
21
-#    main = bge.logic.getSceneList["main"]
22
-
23
-    dict['overlay_fadeout'] = 1
24
-    scenes = bge.logic.getSceneList()
25
-    own['pre_pause_linvel'] = 0.0
26
-
27
-    objList = scene.objects
28
-
29
-    # get object named MainCharacter
30
-    parent = objList["control_cube.002"]
31
-
32
-    # combine child's shape with parent's
33
-    compound = True
34
-    obj = scene.objects['Char4']
35
-    # child is solid
36
-    ghost = False
37
-    # set parent
38
-    obj.setParent( parent, compound, ghost) 
39
-    parent.worldPosition.z += .5 
40
-  
41
-    scene.gravity = [0,0,dict['gravity']]    
42
-    for i in scenes:
43
-        if i.name == "main":
44
-            main = i
45
-    
46
-    for i in scenes:
47
-        if i.name == "fade_out":
48
-            print('ending fade_out', scenes)
49
-            scene2 = i
50
-            scene2.end()  
51
-               
52
-    
53
-    if level == 'newday':
54
-        brightness = 2.6
55
-        cam['BC_BRIGHTNESS'] = 1.3
56
-        cam['BC_CONTRAST'] = 1.5
57
-#    elif level == 'lot':
58
-#        brightness = 2.6
59
-#        cam['BC_BRIGHTNESS'] = 1
60
-#        cam['BC_CONTRAST'] = 1   
61
-#        #main.world.zenithColor = [1.0, .9, .975, 0]
62
-#        #main.world.horizonColor = [.42, .555, .823, 0] 
63
-#        curscene.world.zenithColor = [1.0, .9, .975, 0]
64
-#        curscene.world.horizonColor = [.42, .555, .823, 0]                 
65
-        #print("sadfasdfsdfasdfasdfasdfasdfasdf")
66
-    elif level == 'spine':
67
-        brightness = 2.6
68
-        cam['BC_BRIGHTNESS'] = .85
69
-        cam['BC_CONTRAST'] = 1.1  
12
+    if dict['scene_inited'] == False:
13
+
14
+        own['last_stBut'] = False
15
+        level = dict['level']
70 16
         
71
-    elif level == 'sc':
72
-        print('setting color of', curscene)
73
-        curscene.world.zenithColor = [.23, .23, .25, 1] #[0.1,.2,.4,.5]#[.58, .86, 1.0, 0] #[.3, 0.3, 0.3, 0]
74
-        curscene.world.horizonColor = [.1, .15, .3, 1] #[0.1,0,0,1] #[.58, .86, 1.0, 1]         
17
+        cam = scene.objects['Camera.003']
18
+        curscene = bge.logic.getCurrentScene()
19
+
20
+        dict['overlay_fadeout'] = 1
21
+        scenes = bge.logic.getSceneList()
22
+        own['pre_pause_linvel'] = 0.0
23
+
24
+        objList = scene.objects
25
+
26
+        # get object named MainCharacter
27
+        parent = objList["control_cube.002"]
28
+
29
+        # combine child's shape with parent's
30
+        compound = True
31
+        obj = scene.objects['Char4']
32
+        # child is solid
33
+        ghost = False
34
+        # set parent
35
+        obj.setParent( parent, compound, ghost) 
36
+        parent.worldPosition.z += .5 
37
+      
38
+        scene.gravity = [0,0,dict['gravity']]    
39
+        for i in scenes:
40
+            if i.name == "main":
41
+                main = i
75 42
         
76
-    elif level == 'garage18':
77
-        print('setting color of', curscene)
78
-        curscene.world.zenithColor = [0, 0.0, 0.0, 0]
79
-        curscene.world.horizonColor = [0, 0, 0.0, 0]   
80
-
81
-    elif level == 'pats':
82
-        print('setting color of', curscene)
83
-     
84
-    if dict['bc'] == 1:
85
-        cont.activate(cam.actuators["bc"])
86
-
87
-    else:
88
-        cont.activate(cam.actuators["bc_off"])  
89
-    if dict['hdr'] == 1:
90
-        cont.activate(cam.actuators["hdr"])
91
-
92
-    else:
93
-        cont.activate(cam.actuators["hdr_off"])
94
-                            
95
-    if dict['ao'] == 1:
96
-        cont.activate(cam.actuators["ao"])
97
-
98
-    else:
99
-        cont.activate(cam.actuators["ao_off"])                    
100
-
101
-    if dict['dof_on'] == 1:
102
-        cont.activate(cam.actuators["DOF"])
103
-
104
-    else:
105
-        cont.activate(cam.actuators["DOF_off"])
43
+        for i in scenes:
44
+            if i.name == "fade_out":
45
+                print('ending fade_out', scenes)
46
+                scene2 = i
47
+                scene2.end()  
48
+                   
49
+
50
+         
51
+        if dict['bc'] == 1:
52
+            cont.activate(cam.actuators["bc"])
53
+
54
+        else:
55
+            cont.activate(cam.actuators["bc_off"])  
56
+        if dict['hdr'] == 1:
57
+            cont.activate(cam.actuators["hdr"])
58
+
59
+        else:
60
+            cont.activate(cam.actuators["hdr_off"])
61
+                                
62
+        if dict['ao'] == 1:
63
+            cont.activate(cam.actuators["ao"])
64
+
65
+        else:
66
+            cont.activate(cam.actuators["ao_off"])                    
67
+
68
+        if dict['dof_on'] == 1:
69
+            cont.activate(cam.actuators["DOF"])
70
+
71
+        else:
72
+            cont.activate(cam.actuators["DOF_off"])
73
+            
74
+        if dict['bloom_on'] == 1:
75
+            cont.activate(cam.actuators["Bloom"])
76
+
77
+        else:
78
+            cont.activate(cam.actuators["bloom_off"])
79
+            
80
+    #    print(dict['shadow_on'], 'shadow_on')    
81
+    #    if dict['shadow_on'] == 1:
82
+    #        bge.render.setGLSLMaterialSetting("shadows", 1) 
83
+    #    else:
84
+    #        bge.render.setGLSLMaterialSetting("shadows", 0)  
85
+
86
+        if dict['music_player'] == 1:
87
+            dict['music_start'] =  True   
88
+            print('starting music') 
89
+        else:
90
+            print('not starting music', dict['music_player'])        
91
+            
106 92
         
107
-    if dict['bloom_on'] == 1:
108
-        cont.activate(cam.actuators["Bloom"])
109 93
 
110
-    else:
111
-        cont.activate(cam.actuators["bloom_off"])
94
+        for x in scene.objects:
95
+            if 'hemi' in x:
96
+                if 'down' in x:
97
+                    x.energy = dict['ambient_strength']
98
+                else:
99
+                    x.energy = dict['ambient_strength'] * .7    
100
+
101
+            if 'sun' in x:
102
+                x.energy = dict['sun_strength']
103
+        #scene.world.envLightEnergy = dict['ambient_strength']   
104
+        scene.world.envLightEnergy = 0
105
+        
106
+        cam['BC_BRIGHTNESS'] = dict['BC_BRIGHTNESS'] 
107
+        cam['BC_CONTRAST'] = dict['BC_CONTRAST']
108
+        cam['bc'] = dict['bc']  
109
+        cam['hdr'] = dict['hdr']
110
+        cam['avgL'] = dict['avgL']
111
+        cam['HDRamount'] = dict['HDRamount']
112
+        cam['ao'] = dict['ao']  
113
+        cam['onlyAO'] = dict['onlyAO']
114
+        cam['aowidth'] = dict['aowidth']
115
+        cam['aoradius'] = dict['aoradius']  
116
+        cam['ambient_strength'] = dict['ambient_strength']
117
+        cam['sun_strength'] = dict['sun_strength']
118
+        cam['sun_pos_x'] = dict['sun_rot_x']
119
+        cam['sun_pos_y'] = dict['sun_rot_y']
120
+        #cam['shadow_on'] = dict['shadow_on']
121
+        cam['dof_on'] = dict['dof_on']
122
+        cam['bloom_on'] = dict['bloom_on'] 
123
+        cam['fxaa'] = dict['fxaa']
124
+        cam['FXAA_SPAN_MAX'] = dict['FXAA_SPAN_MAX']     
125
+        own['grindnew_timer'] = 0   
126
+        own['last_ramp'] = 0
127
+        own['requestAction'] = ''
128
+        own['l_actionState'] = ''
129
+        own['actionState'] = ''
130
+        own['transition_timer'] = 0
131
+        own['transitioning'] = 0
132
+        own['driving'] = False
133
+        dict['last_driving'] = False
134
+        own['last_roty'] = 0.0
135
+        
136
+        own['walk_targ_speed'] = 2
137
+        own['walk_fast_targ_speed'] = 5
138
+        own['walk_speed'] = 0
139
+        own['walk_inc'] = .05
140
+        own['walk_jump_timer'] = 0
141
+        own['no_grind_timer'] = 0
142
+        own['last_jump_frame'] = 0
143
+        own['grinder_rot'] = None
112 144
         
113
-#    print(dict['shadow_on'], 'shadow_on')    
114
-#    if dict['shadow_on'] == 1:
115
-#        bge.render.setGLSLMaterialSetting("shadows", 1) 
116
-#    else:
117
-#        bge.render.setGLSLMaterialSetting("shadows", 0)  
118
-
119
-    if dict['music_player'] == 1:
120
-        dict['music_start'] =  True   
121
-        print('starting music') 
122
-    else:
123
-        print('not starting music', dict['music_player'])        
145
+        colors.update_shirt_tex() 
146
+        colors.update_truck_tex()
124 147
         
125
-    
126
-
127
-    for x in scene.objects:
128
-        if 'hemi' in x:
129
-            if 'down' in x:
130
-                x.energy = dict['ambient_strength']
131
-            else:
132
-                x.energy = dict['ambient_strength'] * .7    
133
-
134
-
135
-
136
-    #scene.world.envLightEnergy = dict['ambient_strength']   
137
-    scene.world.envLightEnergy = 0
138
-    
139
-    cam['BC_BRIGHTNESS'] = dict['BC_BRIGHTNESS'] 
140
-    cam['BC_CONTRAST'] = dict['BC_CONTRAST']
141
-    cam['bc'] = dict['bc']  
142
-    cam['hdr'] = dict['hdr']
143
-    cam['avgL'] = dict['avgL']
144
-    cam['HDRamount'] = dict['HDRamount']
145
-    cam['ao'] = dict['ao']  
146
-    cam['onlyAO'] = dict['onlyAO']
147
-    cam['aowidth'] = dict['aowidth']
148
-    cam['aoradius'] = dict['aoradius']  
149
-    cam['ambient_strength'] = dict['ambient_strength']
150
-    cam['sun_strength'] = dict['sun_strength']
151
-    cam['sun_pos_x'] = dict['sun_rot_x']
152
-    cam['sun_pos_y'] = dict['sun_rot_y']
153
-    #cam['shadow_on'] = dict['shadow_on']
154
-    cam['dof_on'] = dict['dof_on']
155
-    cam['bloom_on'] = dict['bloom_on'] 
156
-    cam['fxaa'] = dict['fxaa']
157
-    cam['FXAA_SPAN_MAX'] = dict['FXAA_SPAN_MAX']     
158
-    own['grindnew_timer'] = 0   
159
-    own['last_ramp'] = 0
160
-    own['requestAction'] = ''
161
-    own['l_actionState'] = ''
162
-    own['actionState'] = ''
163
-    own['transition_timer'] = 0
164
-    own['transitioning'] = 0
165
-    own['driving'] = False
166
-    dict['last_driving'] = False
167
-    own['last_roty'] = 0.0
168
-    
169
-    own['walk_targ_speed'] = 2
170
-    own['walk_fast_targ_speed'] = 5
171
-    own['walk_speed'] = 0
172
-    own['walk_inc'] = .05
173
-    own['walk_jump_timer'] = 0
174
-    own['no_grind_timer'] = 0
175
-    own['last_jump_frame'] = 0
176
-    
177
-    colors.update_shirt_tex() 
178
-    colors.update_truck_tex()
179
-    
180
-    print('scene init ran')
148
+        print('scene init ran')
149
+        dict['scene_inited'] = True
181 150
       
182
-main()
151
+#main()

+ 4
- 2
scripts/walk.py View File

@@ -872,13 +872,15 @@ def main(cont):
872 872
                 else:
873 873
                     cont.deactivate(followcam.actuators["down"])                    
874 874
     #            #left
875
-                if lLR < -0.080:
875
+                #if lLR < -0.080:
876
+                if lLR > 0.080:    
876 877
                     followcam.actuators["left"].dLoc = [-camspeed2, 0, 0]                
877 878
                     cont.activate(followcam.actuators["left"])
878 879
                 else:
879 880
                     cont.deactivate(followcam.actuators["left"])                    
880 881
     #            #right
881
-                if lLR > 0.080:         
882
+                #if lLR > 0.080: 
883
+                if lLR < -0.080:         
882 884
                     followcam.actuators["right"].dLoc = [camspeed2, 0, 0]                
883 885
                     cont.activate(followcam.actuators["right"])
884 886
                 else:

+ 25
- 0
scripts/walker_load.py View File

@@ -0,0 +1,25 @@
1
+import bge
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+def main(cont):
10
+    own = cont.owner
11
+    scene = bge.logic.getCurrentScene()
12
+    dict = bge.logic.globalDict
13
+    objList = scene.objects
14
+    mainDir = bge.logic.expandPath("//")
15
+    skater = own['chr']
16
+    
17
+    fileName = mainDir + "npc_walkers/" + str(skater) + '.blend'    
18
+    
19
+    path = bge.logic.expandPath(fileName)
20
+    try:
21
+        bge.logic.LibLoad(path, 'Scene',  load_actions=True,) 
22
+        print(skater, 'loaded')
23
+    except:
24
+        print('trying to load', fileName, 'twice')    
25
+    

+ 323
- 0
scripts/walker_states.py View File

@@ -0,0 +1,323 @@
1
+import bge
2
+from random import randint
3
+from time import clock
4
+   
5
+   
6
+#====================================
7
+class Transition(object):
8
+	def __init__(self, toState):
9
+		self.toState = toState
10
+	def Execute(self):
11
+		#print('Transitioning ...', self.toState)
12
+		pass
13
+			
14
+   
15
+   
16
+#====================================
17
+State = type("State", (object,), {})
18
+
19
+class State(object):
20
+	def __init__(self, FSM):
21
+		self.FSM = FSM
22
+		self.timer = 0
23
+		self.startTime = 0
24
+	def Enter(self):
25
+		pass
26
+		#print('entering')
27
+	def Execute(self):
28
+		pass
29
+		#print('Executing')
30
+	def Exit(self):
31
+		pass
32
+		#print('Exiting')
33
+		
34
+class Target1(State):
35
+	def __init__(self,FSM):
36
+		super(Target1, self).__init__(FSM)    
37
+		
38
+	def Enter(self):
39
+		#print('Preparing to walk towards target 1.')
40
+		self.cont = bge.logic.getCurrentController()
41
+		self.FSM.stateLife = 1
42
+		self.own = self.cont.owner
43
+		self.target = 'larryTarget'
44
+		self.npcArm = self.own.children['npc']
45
+		self.scene = bge.logic.getCurrentScene()
46
+		self.actu = self.cont.actuators['Steering']
47
+
48
+		if 'larryTarget' in self.scene.objects:
49
+				self.actu.target = self.target			
50
+				self.actu.velocity = 1.5
51
+				self.actu.turnspeed = 100
52
+				self.actu.facingMode = True
53
+				self.cont.activate(self.actu)
54
+
55
+		super(Target1, self).Enter()
56
+		
57
+	def Execute(self):
58
+		#print('Tracking target 1.', self.FSM.stateLife)
59
+		self.FSM.stateLife += 1
60
+		duration = 1000
61
+		if self.FSM.stateLife > duration:
62
+			num = randint(1,3)
63
+			if num == 1:
64
+				self.FSM.ToTransition('toTarget2')
65
+			elif num ==2:
66
+				self.FSM.ToTransition('toTarget3')	
67
+			else:
68
+				self.FSM.ToTransition('toIdle')
69
+		else:	
70
+			self.cont.activate(self.actu)	
71
+			self.npcArm.playAction('g_walk2', 1,62, layer=2, play_mode=0, speed=.5)			
72
+			
73
+	def Exit(self):
74
+		#print('Finished target 1') 
75
+		self.cont.deactivate(self.actu) 
76
+
77
+class Target2(State):
78
+	def __init__(self,FSM):
79
+		super(Target2, self).__init__(FSM)    
80
+		
81
+	def Enter(self):
82
+		#print('Preparing to walk towards target 2.')
83
+		self.cont = bge.logic.getCurrentController()
84
+		self.FSM.stateLife = 1
85
+		self.own = self.cont.owner
86
+		self.target = 'larryTarget.001'
87
+		self.npcArm = self.own.children['npc']
88
+		self.scene = bge.logic.getCurrentScene()
89
+		self.actu = self.cont.actuators['Steering']
90
+
91
+		if 'larryTarget.001' in self.scene.objects:
92
+				self.actu.target = self.target			
93
+				self.actu.velocity = 1.5
94
+				self.actu.turnspeed = 100
95
+				self.actu.facingMode = True
96
+				self.cont.activate(self.actu)
97
+
98
+		super(Target2, self).Enter()
99
+		
100
+	def Execute(self):
101
+		#print('Tracking target 2.', self.FSM.stateLife)
102
+		self.FSM.stateLife += 1
103
+		duration = 1000
104
+		if self.FSM.stateLife > duration:
105
+			num = randint(1,3)
106
+			if num == 1:
107
+				self.FSM.ToTransition('toTarget1')
108
+			elif num ==2:
109
+				self.FSM.ToTransition('toTarget3')	
110
+			else:
111
+				self.FSM.ToTransition('toIdle')
112
+		else:		
113
+			self.cont.activate(self.actu)
114
+			self.npcArm.playAction('g_walk2', 1,62, layer=2, play_mode=0, speed=.5)			
115
+							
116
+				
117
+	def Exit(self):
118
+		#print('Finished target 2') 
119
+		self.cont.deactivate(self.actu)          
120
+		
121
+class Target3(State):
122
+	def __init__(self,FSM):
123
+		super(Target3, self).__init__(FSM)    
124
+		
125
+	def Enter(self):
126
+		#print('Preparing to walk towards target 3.')
127
+		self.cont = bge.logic.getCurrentController()
128
+		self.FSM.stateLife = 1
129
+		self.own = self.cont.owner
130
+		self.target = 'larryTarget.002'
131
+		self.npcArm = self.own.children['npc']
132
+		self.scene = bge.logic.getCurrentScene()
133
+		self.actu = self.cont.actuators['Steering']
134
+
135
+		if 'larryTarget.002' in self.scene.objects:
136
+				self.actu.target = self.target			
137
+				self.actu.velocity = 1.5
138
+				self.actu.turnspeed = 100
139
+				self.actu.facingMode = True
140
+				self.cont.activate(self.actu)
141
+		super(Target3, self).Enter()
142
+
143
+		
144
+	def Execute(self):
145
+		#print('Vacumming.', self.FSM.stateLife)
146
+		self.FSM.stateLife += 1
147
+		duration = 1200
148
+		if self.FSM.stateLife > duration:
149
+			if not (randint(1,3) % 2):
150
+				self.FSM.ToTransition('toTarget1')
151
+			else:
152
+				self.FSM.ToTransition('toIdle')
153
+		else:
154
+			cont = bge.logic.getCurrentController()
155
+			own = cont.owner
156
+			npcArm = own.children['npc']
157
+			npcArm.playAction('g_walk2', 1,62, layer=2, play_mode=0, speed=.5)		
158
+			#npcArm.playAction('npcImpatient', 2,135, layer=2, play_mode=0, speed=.25)	
159
+
160
+	def Exit(self):
161
+		#print('Finished target 3') 
162
+		self.cont.deactivate(self.actu)              
163
+		
164
+		
165
+class Idle(State):
166
+	
167
+	def __init__(self,FSM):
168
+		super(Idle, self).__init__(FSM)  
169
+		
170
+	def Enter(self):
171
+		#print('Starting to idle.')
172
+
173
+
174
+		self.cont = bge.logic.getCurrentController()
175
+		self.FSM.stateLife = 1
176
+		self.own = self.cont.owner
177
+		self.npcArm = self.own.children['npc']
178
+
179
+		super(Idle, self).Enter()
180
+		
181
+	def Execute(self):
182
+		#print('Idleing.', self.FSM.stateLife)
183
+		self.FSM.stateLife += 1
184
+		duration = 600
185
+		if self.FSM.stateLife > duration:
186
+			num = randint(1,4)
187
+			if num == 1:
188
+				self.FSM.ToTransition('toTarget1')
189
+			elif num == 2:
190
+				self.FSM.ToTransition('toTarget2')	
191
+			elif num == 3:
192
+				self.FSM.ToTransition('toTarget3')
193
+			elif num == 4 or num == 5 or num == 6:
194
+				self.FSM.ToTransition('toImpatient')										
195
+			else:
196
+				self.FSM.ToTransition('toIdle')
197
+		else:
198
+			#pass
199
+			self.npcArm.playAction('g_idle', 1,201, layer=2, play_mode=0, speed=.5)	
200
+			
201
+	def Exit(self):
202
+		pass
203
+		##print('Waking up from idle.') 
204
+
205
+class Impatient(State):
206
+	
207
+	def __init__(self,FSM):
208
+		super(Impatient, self).__init__(FSM)  
209
+		
210
+	def Enter(self):
211
+		#print('Starting to idle.')
212
+		self.FSM.stateLife = 1
213
+		self.cont = bge.logic.getCurrentController()
214
+		self.own = self.cont.owner
215
+		self.npcArm = self.own.children['npc']	
216
+		super(Impatient, self).Enter()
217
+		
218
+	def Execute(self):
219
+		##print('being Impatient.', self.FSM.stateLife)
220
+		self.FSM.stateLife += 1
221
+		duration = 600
222
+		if self.FSM.stateLife > duration:
223
+			self.FSM.ToTransition('toIdle')
224
+		else:
225
+			self.npcArm.playAction('npcImpatient', 1,201, layer=2, play_mode=0, speed=.5)	
226
+			
227
+	def Exit(self):
228
+		pass
229
+		#print('stopping bening impatient.') 		         
230
+						   
231
+					 
232
+#===================================
233
+						
234
+
235
+class FSM(object):
236
+	def __init__ (self, character):
237
+		self.char = character
238
+		self.states = {}
239
+		self.transitions = {}
240
+		self.curState = None
241
+		self.prevState = None
242
+		self.trans = None
243
+		self.stateLife = 0
244
+		
245
+	def AddTransition(self, transName, transition):
246
+		self.transitions[transName] = transition
247
+	
248
+	def AddState(self, stateName, state):
249
+		self.states[stateName] = state        
250
+		
251
+	def SetState(self, stateName):
252
+		self.prevState = self.curState
253
+		self.curState = self.states[stateName]
254
+		
255
+	def ToTransition(self, toTrans):
256
+		self.trans = self.transitions[toTrans]
257
+		
258
+	def Execute(self):
259
+		if (self.trans):
260
+			self.curState.Exit()
261
+			self.trans.Execute()
262
+			self.SetState(self.trans.toState)
263
+			self.curState.Enter()
264
+			self.trans = None        
265
+		self.curState.Execute()    
266
+				
267
+#====================================
268
+Char = type("Char",(object,),{})
269
+
270
+class Walker(Char):
271
+	def __init__(self):
272
+		self.FSM = FSM(self)
273
+		#cont = bge.logic.getCurrentController()
274
+		#own = cont.owner
275
+		#self.LightOn = own['state']
276
+		
277
+		##STATES
278
+		self.FSM.AddState("Idle", Idle(self.FSM))
279
+		
280
+		self.FSM.AddState("Impatient", Impatient(self.FSM))
281
+		self.FSM.AddState('Target1', Target1(self.FSM))
282
+		self.FSM.AddState('Target3', Target3(self.FSM))
283
+		self.FSM.AddState('Target2', Target2(self.FSM))
284
+		
285
+		#TRANSITIONS
286
+		self.FSM.AddTransition('toIdle', Transition('Idle'))
287
+		self.FSM.AddTransition('toImpatient', Transition('Impatient'))
288
+		self.FSM.AddTransition('toTarget3', Transition('Target3'))
289
+		self.FSM.AddTransition('toTarget1', Transition('Target1'))
290
+		self.FSM.AddTransition('toTarget2', Transition('Target2'))
291
+		
292
+		
293
+		if self.FSM.curState == None:
294
+			self.FSM.SetState('Idle')
295
+			#print('setting none')
296
+	
297
+	def Execute(self):
298
+		self.FSM.Execute()    
299
+#====================================     
300
+r = Walker()
301
+def main(cont):
302
+	own = cont.owner   
303
+	scene = bge.logic.getCurrentScene()
304
+	if 'inited' not in own:
305
+		own['inited'] = True
306
+		own['frame'] = 0
307
+		own['state'] = 'On'
308
+		#print('initing')
309
+
310
+	if own['frame'] == 40:
311
+		own.worldPosition = [0,0,50]	
312
+
313
+		ln = own['cName'] + '_loader'
314
+		if ln in scene.objects:
315
+			to = scene.objects[ln]	
316
+			own.worldPosition = to.worldPosition
317
+			own.worldPosition.z += 50
318
+
319
+
320
+	r.Execute()    
321
+	##print(r.FSM.curState)
322
+	
323
+	own['frame'] += 1			

+ 2
- 2
shuvit.blend View File

@@ -1,3 +1,3 @@
1 1
 version https://git-lfs.github.com/spec/v1
2
-oid sha256:2a72807221c2e589f2152198d8bdd7b10f67153f571f7808b3ae9f456ba4931d
3
-size 181395308
2
+oid sha256:6ce5c15dce7d44d729cac00ff3d914ad1102691223ed5c67381a2a6f5e8bf8fb
3
+size 134865180

+ 3
- 0
textures/vignette.png View File

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

Loading…
Cancel
Save