shuvit 4 years ago
parent
commit
91d9ba38ed
58 changed files with 538 additions and 126 deletions
  1. 3
    0
      assets/bench.blend
  2. 2
    2
      assets/ledges.blend
  3. 3
    0
      assets/lion.blend
  4. 2
    2
      assets/materials/base_m_kit.blend
  5. 3
    0
      assets/mini_b.blend
  6. 1
    1
      assets/nav_points
  7. 2
    2
      assets/roads.blend
  8. 3
    0
      assets/sc.blend
  9. 2
    2
      assets/stairs.blend
  10. 3
    0
      assets/stores.blend
  11. 3
    0
      assets/textures/bench_ao.png
  12. 3
    0
      assets/textures/bench_diffuse.png
  13. 3
    0
      assets/textures/bench_n.png
  14. 2
    2
      assets/user2.blend
  15. 3
    0
      assets/user2_bak2.blend
  16. 0
    3
      assets/user3_working.blend
  17. 0
    3
      assets/user4_working.blend
  18. 3
    0
      assets/user6_working.blend
  19. 3
    0
      assets/utils/mini_ramp_gen15new_text_tmp.blend
  20. 3
    0
      assets/utils/stores.blend
  21. 1
    1
      assets/walker_nav_points
  22. 3
    0
      assets/wall.blend
  23. 33
    33
      config.ini
  24. 3
    0
      npc_walkers/carlos.blend
  25. 3
    0
      npc_walkers/charlie.blend
  26. 3
    0
      npc_walkers/denise.blend
  27. 3
    0
      npc_walkers/maria.blend
  28. 5
    1
      scripts/FSM.py
  29. 3
    3
      scripts/Startup.py
  30. 92
    15
      scripts/StatesCar.py
  31. 195
    23
      scripts/StatesWalker.py
  32. 4
    2
      scripts/astar.py
  33. 3
    3
      scripts/cars.py
  34. 9
    4
      scripts/controller2.py
  35. 19
    0
      scripts/main.py
  36. 2
    1
      scripts/scene_init.py
  37. 49
    19
      scripts/walkers.py
  38. 2
    2
      shuvit.blend
  39. 3
    0
      textures/M_Trousers_02.png
  40. 3
    0
      textures/M_Trousers_02_NRM.png
  41. 3
    0
      textures/afro_diffuse.png
  42. 3
    0
      textures/brown_eye.png
  43. 3
    0
      textures/eyebrow001.png
  44. 3
    0
      textures/female_casualsuit01_diffuse.png
  45. 3
    0
      textures/female_casualsuit01_diffuse2.png
  46. 3
    0
      textures/female_casualsuit01_normal.png
  47. 3
    0
      textures/lightblue_eye.png
  48. 3
    0
      textures/male_casualsuit06_diffuse.png
  49. 3
    0
      textures/male_casualsuit06_normal.png
  50. 3
    0
      textures/middleage_darkskinned_male_diffuse.png
  51. 3
    0
      textures/old_lightskinned_male_diffuse2.png
  52. 3
    0
      textures/ponytail01_diffuse.png
  53. 3
    0
      textures/shoes05_diffuse.png
  54. 3
    0
      textures/short01_diffuse.png
  55. 3
    0
      textures/wb_normals.png
  56. 3
    0
      textures/wb_tex3.png
  57. 3
    0
      textures/young_darkskinned_female_diffuse.png
  58. 2
    2
      textures/young_lightskinned_female_diffuse.png

+ 3
- 0
assets/bench.blend View File

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

+ 2
- 2
assets/ledges.blend View File

@@ -1,3 +1,3 @@
1 1
 version https://git-lfs.github.com/spec/v1
2
-oid sha256:f421d34a40921e1a91067a4d8eb7530d8bfe173b45cfe7a14452775011c9e4fe
3
-size 5657192
2
+oid sha256:0f1ab893aeb027fb7f1b68da3136d388ff3fadf8e59f76ffe726bf17292ca218
3
+size 4124080

+ 3
- 0
assets/lion.blend View File

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

+ 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:bb965ff58e243cdebf548530bf6f11f9807cb2236c36abde72528d7f674eea69
3
-size 43913880
2
+oid sha256:8e8bbc46fe8a241bafb503b8fe9d3f8e054a5182a11d637f0c16b39fff237680
3
+size 43913896

+ 3
- 0
assets/mini_b.blend View File

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

+ 1
- 1
assets/nav_points
File diff suppressed because it is too large
View File


+ 2
- 2
assets/roads.blend View File

@@ -1,3 +1,3 @@
1 1
 version https://git-lfs.github.com/spec/v1
2
-oid sha256:0e10dc0a2611d85faa40c6ec04a0476083b75a72c97bd84f2ab6f80afb9ab8b5
3
-size 19716272
2
+oid sha256:9c8a35c0558f473447386c4a32da1536dc5719c37262e8c1b8bb55cd3dd782b4
3
+size 20668232

+ 3
- 0
assets/sc.blend View File

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

+ 2
- 2
assets/stairs.blend View File

@@ -1,3 +1,3 @@
1 1
 version https://git-lfs.github.com/spec/v1
2
-oid sha256:7021eaf0bf81aa197c2ddaf54b3e812cb829f31cc01e5429b3a3b7275ff72c72
3
-size 1301996
2
+oid sha256:4f6767797f108ead14c6beb09cab9bf69ec6aef97290814d8853c9afe043b67d
3
+size 1260916

+ 3
- 0
assets/stores.blend View File

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

+ 3
- 0
assets/textures/bench_ao.png View File

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

+ 3
- 0
assets/textures/bench_diffuse.png View File

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

+ 3
- 0
assets/textures/bench_n.png View File

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

+ 2
- 2
assets/user2.blend View File

@@ -1,3 +1,3 @@
1 1
 version https://git-lfs.github.com/spec/v1
2
-oid sha256:dc009564a91c8f497cac0c720a59789d4d699499224142aff31456f6266eac0c
3
-size 9294436
2
+oid sha256:3b2527ea21c996d8837f676c7320b0fee9ed4fe5fe34fd5812fb4fd6f688d025
3
+size 12474024

+ 3
- 0
assets/user2_bak2.blend View File

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

+ 0
- 3
assets/user3_working.blend View File

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

+ 0
- 3
assets/user4_working.blend View File

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

+ 3
- 0
assets/user6_working.blend View File

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

+ 3
- 0
assets/utils/mini_ramp_gen15new_text_tmp.blend View File

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

+ 3
- 0
assets/utils/stores.blend View File

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

+ 1
- 1
assets/walker_nav_points
File diff suppressed because it is too large
View File


+ 3
- 0
assets/wall.blend View File

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

+ 33
- 33
config.ini View File

@@ -15,7 +15,7 @@ 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
 
@@ -50,58 +50,58 @@ walk_focal_length = 14
50 50
 #character settings
51 51
 ###################
52 52
 
53
-character = ralph
53
+character = annie
54 54
 
55 55
 shirt_logo = 2
56 56
 
57
-shirt_color_r = 0.64
58
-shirt_color_g = 0.59
59
-shirt_color_b = 0.03
57
+shirt_color_r = 0.38
58
+shirt_color_g = 0.0
59
+shirt_color_b = 0
60 60
 
61
-shoe_color_r = 0.05
61
+shoe_color_r = 0.03
62 62
 shoe_color_g = 0.03
63 63
 shoe_color_b = 0.03
64 64
 #-----------------
65 65
 
66 66
 #deck settings
67 67
 ##############
68
-deck_index = 6
69
-deck_color_r = 0.1
70
-deck_color_g = 0.05
71
-deck_color_b = 0.08
72
-trucks_r = 0.92
73
-trucks_g = 0.85
74
-trucks_b = 1
75
-
76
-wheel1_r = 0.03
77
-wheel1_g = 0
78
-wheel1_b = 0
79
-wheel2_r = 0.03
80
-wheel2_g = 0
81
-wheel2_b = 0
82
-wheel3_r = 0.03
83
-wheel3_g = 0
84
-wheel3_b = 0
85
-wheel4_r = 0.03
86
-wheel4_g = 0
87
-wheel4_b = 0
68
+deck_index = 5
69
+deck_color_r = 0.8
70
+deck_color_g = 0.8
71
+deck_color_b = 0.8
72
+trucks_r = 0
73
+trucks_g = 0
74
+trucks_b = 0
75
+
76
+wheel1_r = 0.21
77
+wheel1_g = 0.21
78
+wheel1_b = 0.21
79
+wheel2_r = 0.21
80
+wheel2_g = 0.21
81
+wheel2_b = 0.21
82
+wheel3_r = 0.21
83
+wheel3_g = 0.21
84
+wheel3_b = 0.21
85
+wheel4_r = 0.21
86
+wheel4_g = 0.21
87
+wheel4_b = 0.21
88 88
 #-------------------
89 89
 
90 90
 #2d filter settings
91 91
 ###################
92 92
 
93 93
 #brightness / contrast
94
-bc = 0
94
+bc = 1
95 95
 BC_BRIGHTNESS = 1.05
96 96
 BC_CONTRAST = 1.06
97 97
 
98 98
 #HDR
99
-hdr = 0
99
+hdr = 1
100 100
 avgL = 0.72
101 101
 HDRamount = 0.3
102 102
 
103 103
 #Ambient Occlusion
104
-ao = 0
104
+ao = 1
105 105
 onlyAO = 0
106 106
 aowidth = 0.2
107 107
 aoradius = 2.4
@@ -110,17 +110,17 @@ aoradius = 2.4
110 110
 dof_on = 0
111 111
 
112 112
 #Bloom
113
-bloom_on = 0
113
+bloom_on = 1
114 114
 
115 115
 #FXAA
116
-fxaa = 0
116
+fxaa = 1
117 117
 FXAA_SPAN_MAX = 8.0
118 118
 #-------------------
119 119
 
120 120
 #sun settings
121 121
 #############
122 122
 sun_strength = 1.85
123
-ambient_strength = 0.35
123
+ambient_strength = 0.37
124 124
 sun_rot_x = -0.05
125 125
 sun_rot_y = -0.05
126 126
 shadow_on = 0
@@ -128,7 +128,7 @@ shadow_on = 0
128 128
 
129 129
 #physics
130 130
 ########
131
-JUMPHEIGHT = 940#880#840#800
131
+JUMPHEIGHT = 980#940#880#840#800
132 132
 MAX_VEL = 6.7
133 133
 SPEEDUP = 0.055
134 134
 SPEEDPUMP = 0.14#.09

+ 3
- 0
npc_walkers/carlos.blend View File

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

+ 3
- 0
npc_walkers/charlie.blend View File

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

+ 3
- 0
npc_walkers/denise.blend View File

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

+ 3
- 0
npc_walkers/maria.blend View File

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

+ 5
- 1
scripts/FSM.py View File

@@ -143,7 +143,11 @@ class WalkerFSM(Char):
143 143
         'ExitParallelPark',
144 144
         'EnterParallelPark',
145 145
         'NavigateToTarget', 
146
-        'RequestPath']
146
+        'RequestPath',
147
+        'HitBySkater',
148
+        'WalkingHitBySkater',
149
+        'Dance1',
150
+        'GoToSleep']
147 151
 
148 152
         
149 153
         for s in state_list:

+ 3
- 3
scripts/Startup.py View File

@@ -1,7 +1,7 @@
1 1
 import bge
2 2
 
3
-def main():
4
-    cont = bge.logic.getCurrentController() 
3
+def main(cont):
4
+    #cont = bge.logic.getCurrentController() 
5 5
     own = cont.owner
6 6
     scenes = bge.logic.getSceneList()
7 7
 
@@ -109,4 +109,4 @@ def main():
109 109
     dict['scene_inited'] = True
110 110
     dict['p1c'] = None
111 111
     
112
-main()
112
+#main()

+ 92
- 15
scripts/StatesCar.py View File

@@ -2,6 +2,8 @@ import utils
2 2
 import bge
3 3
 import random
4 4
 from mathutils import Vector
5
+import mathutils
6
+#import math
5 7
 
6 8
 #====================================     
7 9
 
@@ -66,6 +68,9 @@ def find_new_parking(self):
66 68
     if len(potentials) > 0:
67 69
         new_parking = random.choice(potentials)
68 70
         path2 = self.manager.navmesh2.queue_path(self.start_empty.obj.worldPosition, new_parking.obj.worldPosition, self)
71
+        #print('astar request')
72
+        #if path2 is not None:
73
+            
69 74
         return new_parking, path2
70 75
     else:
71 76
         self.FSM.FSM.ToTransition('toEnterParallelPark')
@@ -94,10 +99,10 @@ def update_point(self):
94 99
             else:
95 100
                 self.path_index += 1
96 101
          
97
-def align_to_point(self):
102
+def align_to_point(self, mult):
98 103
     v = self.obj.getVectTo(self.lane_point)[1]
99 104
     v.z = 0
100
-    self.obj.alignAxisToVect(v, 0, .1)
105
+    self.obj.alignAxisToVect(v, 0, .05 * mult)
101 106
 
102 107
 def delta_to_vect(self):
103 108
     v = self.obj.getVectTo(self.lane_point)[1]
@@ -109,15 +114,67 @@ def delta_to_vect(self):
109 114
 
110 115
     #check if in front
111 116
     local = self.obj.worldOrientation.inverted() * (self.lane_point - self.obj.worldPosition) 
112
-    f = deltamove * 50
117
+    f = deltamove * 500
113 118
     if local < 0:
114 119
         f *= -1
115 120
     self.obj.applyForce([0, f, 0], True)
116 121
             
117 122
               
118
-def apply_gas(self):
119
-    if self.obj.linearVelocity.x < self.speed_targ:
120
-        self.obj.applyForce([self.speed_inc, 0, 0], True)
123
+def apply_gas(self, mult):
124
+    if self.obj.linearVelocity.x < self.speed_targ * mult:
125
+        self.obj.applyForce([self.speed_inc * mult, 0, 0], True)
126
+
127
+def starting_mod(self):
128
+    #print('doing path mod')
129
+    #self.path[0] = self.start_empty.obj.worldPosition
130
+    #del self.path[0]
131
+    path2 = self.path
132
+    path2.append(self.target.obj.worldPosition) #add endpoint
133
+    path2.append(self.target.obj.worldPosition) 
134
+
135
+    #check if vector between 1 and start point and vector between 2 and sp are the same dir
136
+    # v1 = Vector(self.start_empty.obj.worldPosition).normalized() - Vector(self.path[0]).normalized()
137
+    # v2 = Vector(self.start_empty.obj.worldPosition).normalized() - Vector(self.path[1]).normalized()
138
+    # lens = []
139
+    # lens.append(len(self.path))
140
+    # if v1.dot(v2) < 0:
141
+    #     del self.path[0]
142
+    # lens.append(len(self.path))
143
+    # del self.path[0]   
144
+    # lens.append(len(self.path))
145
+    # del self.path[0]    
146
+    # lens.append(len(self.path))
147
+    # print(lens, 'path length', v1.dot(v2))
148
+
149
+def check_front(self):    #
150
+    #obj_vec = self.obj.worldOrientation[0].normalized()
151
+    obj_vec = self.obj.getAxisVect([1,0,0])
152
+    targ_vec = self.obj.getVectTo(self.path[self.path_index] +1)[1].normalized()
153
+    dot_ = obj_vec.dot(targ_vec)
154
+
155
+    # while dot_ < 0:
156
+    #     del self.path[0]
157
+    #     targ_vec = self.obj.getVectTo(self.path[0])[1].normalized()
158
+    #     dot_ = obj_vec.dot(targ_vec)
159
+    if dot_ > 0:
160
+        print('in front', self)
161
+    else:
162
+        print('behind', self)
163
+
164
+    if dot_ > 0:
165
+        return True
166
+    else:
167
+        return False
168
+    #get starting pos
169
+    # v = Vector([path2[0].x - path2[1].x, path2[0].y - path2[1].y, 0])
170
+    # tv = v.normalized()
171
+    # nv = Vector([-tv.y, tv.x, 0])
172
+    # print('og', path2[0])
173
+    # path2[0] = path2[0] + -.2 * nv
174
+    # print('mod1', path2[0])
175
+    # #path2[0] *= nv
176
+    # print('mod2', path2[0])    
177
+    # self.path = path2    
121 178
 
122 179
 #====================================     
123 180
 
@@ -164,23 +221,43 @@ class ExitParallelPark(State):
164 221
         self.FSM.owner.obj.restorePhysics()
165 222
         self.FSM.owner.obj.restoreDynamics()
166 223
         self.FSM.owner.obj.linearVelocity = [0,0,0]
167
-        self.FSM.owner.path_index = 0
224
+        self.FSM.owner.path_index = 1
225
+        get_lane_point(self.FSM.owner)
168 226
         try:
169 227
             self.FSM.owner.point = self.FSM.owner.path[self.FSM.owner.path_index]
170 228
         except:
171 229
             print('no path')    
172 230
         self.FSM.owner.target.status = 'targetted'
173 231
         self.FSM.owner.start_empty.status = 'available'
232
+        starting_mod(self.FSM.owner)
174 233
         super(ExitParallelPark, self).Enter()        
175 234
         
176 235
     def Execute(self):
177 236
         self.FSM.stateLife += 1
237
+        set_height(self.FSM.owner)
178 238
         if self.FSM.owner.path != []:
179
-            v = self.FSM.owner.obj.getVectTo(self.FSM.owner.path[0])
180
-            self.FSM.owner.obj.alignAxisToVect(v[1], 0, .01)
181
-            self.FSM.owner.obj.alignAxisToVect([0,0,1], 2, 1)
182
-            if self.FSM.stateLife > 220:
239
+            update_point(self.FSM.owner)
240
+            #v = self.FSM.owner.obj.getVectTo(self.FSM.owner.path[0])
241
+            #v = self.FSM.owner.obj.getVectTo(self.FSM.owner.lane_point)            
242
+            #print(v[0])
243
+            #self.FSM.owner.obj.alignAxisToVect(v[1], 0, .02)
244
+            #self.FSM.owner.obj.alignAxisToVect([0,0,1], 2, 1)
245
+            #if self.FSM.stateLife > 160 or self.FSM.owner.obj.getDistanceTo(self.FSM.owner.lane_point) < 2:
246
+            #if self.FSM.owner.obj.getDistanceTo(self.FSM.owner.path[0]) < 3.5:# or (self.FSM.stateLife > 30 and check_front(self.FSM.owner)):  
247
+            if self.FSM.owner.path_index > 1:    
248
+                #print('exiting park')  
249
+                #self.FSM.owner.path_index = 2
183 250
                 self.FSM.ToTransition('toNavigateToTarget')
251
+            
252
+
253
+            align_to_point(self.FSM.owner, .65)
254
+            align_to_road(self.FSM.owner)
255
+            #set_height(self.FSM.owner)
256
+            delta_to_vect(self.FSM.owner)
257
+            apply_gas(self.FSM.owner, .5)  
258
+
259
+            #if self.FSM.stateLife < 30:
260
+                #self.FSM.owner.obj.applyRotation([0,0,.0075], True)  
184 261
 
185 262
     def Exit(self):
186 263
         pass        
@@ -214,7 +291,7 @@ class EnterParallelPark(State):
214 291
         if self.FSM.stateLife == 2:
215 292
             self.FSM.owner.manager.cars_active.remove(self.FSM.owner)
216 293
             self.FSM.owner.obj.suspendDynamics()
217
-            self.FSM.owner.obj.suspendPhysics()
294
+            #self.FSM.owner.obj.suspendPhysics()
218 295
     def Exit(self):
219 296
         pass
220 297
 
@@ -233,14 +310,14 @@ class NavigateToTarget(State):
233 310
         self.FSM.stateLife += 1
234 311
         update_point(self.FSM.owner)
235 312
 
236
-        align_to_point(self.FSM.owner)
313
+        align_to_point(self.FSM.owner, 1)
237 314
         align_to_road(self.FSM.owner)
238 315
         set_height(self.FSM.owner)
239 316
         delta_to_vect(self.FSM.owner)
240
-        apply_gas(self.FSM.owner)
317
+        apply_gas(self.FSM.owner, 1)
241 318
 
242 319
         #emergency exit
243
-        if self.FSM.stateLife > 30 * 60:
320
+        if self.FSM.stateLife > 30 * 90:
244 321
             self.FSM.ToTransition('toEnterParallelPark')
245 322
 
246 323
     def Exit(self):

+ 195
- 23
scripts/StatesWalker.py View File

@@ -83,13 +83,25 @@ def get_lane_point(self):
83 83
     else:
84 84
         pass
85 85
 
86
-def update_point(self):
87
-    if self.path_index >= (len(self.path) ):
88
-        self.FSM.FSM.ToTransition('toEnterParallelPark')
86
+def goal_reached(self):
87
+    print(self.target.type, 'type')
88
+    if self.target.type == 'corner':
89
+        print('this is a corner')
90
+        self.FSM.FSM.ToTransition('toDance1')
89 91
     else:
92
+        self.FSM.FSM.ToTransition('toEnterParallelPark')
93
+
94
+def update_point(self):
95
+    if self.path_index >= (len(self.path)): #at the end
96
+        goal_reached(self)
97
+        #self.FSM.FSM.ToTransition('toEnterParallelPark')
98
+    else: #do normal path
99
+        check_dist = 2.5
100
+        if self.path_index == len(self.path) - 1:
101
+            check_dist = 1.0
90 102
         dist = self.obj.getDistanceTo(self.lane_point)
91 103
         self.point = self.path[self.path_index]
92
-        if dist < 2.5:
104
+        if dist < check_dist:
93 105
             get_lane_point(self)   
94 106
             if self.path_index > (len(self.path)):
95 107
                 pass
@@ -123,7 +135,14 @@ def apply_gas(self):
123 135
 def walk_anim(self):
124 136
     if self.obj.linearVelocity.x > .5:
125 137
         arm = self.obj.children['npc']
126
-        arm.playAction('g_walk2', 1,62, layer=1, play_mode=0, speed=.5) 
138
+        #arm.playAction('g_walk2', 1,62, layer=1, play_mode=0, speed=.5)
139
+        arm.playAction('npc_walk', 1,30, layer=1, play_mode=0, speed=.5, blendin=10) 
140
+
141
+
142
+def starting_mod(self):
143
+    path2 = self.path
144
+    path2.append(self.target.obj.worldPosition) 
145
+    path2.append(self.target.obj.worldPosition)        
127 146
 
128 147
 #====================================     
129 148
 
@@ -150,8 +169,6 @@ class Example(State):
150 169
     def Enter(self):
151 170
         self.FSM.stateLife = 1
152 171
         #self.FSM.owner.obj.worldPosition = self.FSM.owner.start_empty.obj.worldPosition
153
-        #self.FSM.owner.resumePhysics()
154
-        #self.FSM.owner.resumeDynamics()
155 172
         #print('physics resumed')
156 173
         super(Example, self).Enter()        
157 174
         
@@ -168,23 +185,34 @@ class ExitParallelPark(State):
168 185
         
169 186
     def Enter(self):
170 187
         self.FSM.stateLife = 1
171
-        self.FSM.owner.obj.restorePhysics()
172
-        self.FSM.owner.obj.restoreDynamics()
188
+        set_height(self.FSM.owner)
189
+        #self.FSM.owner.obj.restorePhysics()
190
+        #self.FSM.owner.obj.restoreDynamics()
173 191
         self.FSM.owner.obj.linearVelocity = [0,0,0]
174 192
         self.FSM.owner.path_index = 0
175
-        self.FSM.owner.point = self.FSM.owner.path[self.FSM.owner.path_index]
193
+        try:
194
+            self.FSM.owner.point = self.FSM.owner.path[self.FSM.owner.path_index]
195
+        except:
196
+            self.FSM.ToTransition('toEnterParallelPark')    
176 197
         self.FSM.owner.target.status = 'targetted'
177 198
         self.FSM.owner.start_empty.status = 'available'
199
+        if self.FSM.owner.start_empty.type == 'corner':
200
+            self.FSM.owner.obj.children['npc'].stopAction(1)
201
+        else:
202
+            self.FSM.owner.obj.children['npc'].playAction('npc_sit', 90,1, layer=1, play_mode=0, speed=.5, blendin=10)
203
+        starting_mod(self.FSM.owner)
178 204
         print('physics resumed')
179 205
         super(ExitParallelPark, self).Enter()        
180 206
         
181 207
     def Execute(self):
208
+        set_height(self.FSM.owner)
182 209
         self.FSM.stateLife += 1
183
-        v = self.FSM.owner.obj.getVectTo(self.FSM.owner.path[0])
184
-        self.FSM.owner.obj.alignAxisToVect(v[1], 0, .01)
185
-        self.FSM.owner.obj.alignAxisToVect([0,0,1], 2, 1)
186
-        if self.FSM.stateLife > 220:
187
-            self.FSM.ToTransition('toNavigateToTarget')
210
+        if self.FSM.stateLife > 30:
211
+            v = self.FSM.owner.obj.getVectTo(self.FSM.owner.path[0])
212
+            self.FSM.owner.obj.alignAxisToVect(v[1], 0, .01)
213
+            self.FSM.owner.obj.alignAxisToVect([0,0,1], 2, 1)
214
+            if self.FSM.stateLife > 220:
215
+                self.FSM.ToTransition('toNavigateToTarget')
188 216
 
189 217
     def Exit(self):
190 218
         pass        
@@ -197,11 +225,11 @@ class EnterParallelPark(State):
197 225
         
198 226
     def Enter(self):
199 227
         self.FSM.stateLife = 1
200
-        self.FSM.owner.obj.worldPosition = self.FSM.owner.target.obj.worldPosition.copy()
201
-        self.FSM.owner.obj.worldOrientation = self.FSM.owner.target.obj.worldOrientation.copy()
202
-        self.FSM.owner.obj.applyMovement([0, 0, 0], True)
228
+        #self.FSM.owner.obj.worldPosition = self.FSM.owner.target.obj.worldPosition.copy()
229
+        #self.FSM.owner.obj.worldOrientation = self.FSM.owner.target.obj.worldOrientation.copy()
230
+        #self.FSM.owner.obj.applyMovement([0, 0, 0], True)
203 231
         self.FSM.owner.target.status = 'in_use'
204
-        self.FSM.owner.obj.worldPosition.z += .9
232
+        #self.FSM.owner.obj.worldPosition.z += .9
205 233
         self.FSM.owner.active = False
206 234
         self.FSM.owner.start_empty = self.FSM.owner.target
207 235
         self.FSM.owner.last_point = self.FSM.owner.target.obj.worldPosition.copy()
@@ -210,14 +238,51 @@ class EnterParallelPark(State):
210 238
         self.FSM.owner.point = self.FSM.owner.target.obj.worldPosition.copy()
211 239
         self.FSM.owner.path_index = 0
212 240
         self.FSM.owner.path = None
241
+        self.lerp_len = 90
242
+        self.s_p = self.FSM.owner.obj.worldPosition.copy()
243
+        self.s_o = self.FSM.owner.obj.worldOrientation.copy()
244
+        self.FSM.owner.obj.linearVelocity = [0, 0, 0]
245
+        self.e_p = self.FSM.owner.target.obj.worldPosition.copy()
246
+        self.e_o = self.FSM.owner.target.obj.worldOrientation.copy()
247
+        #self.FSM.owner.obj.children['npc'].playAction('npc_sit', 1,90, layer=1, play_mode=0, speed=.5, blendin=10)
248
+        set_height(self.FSM.owner)
213 249
         super(EnterParallelPark, self).Enter()        
214 250
         
215 251
     def Execute(self):
216 252
         self.FSM.stateLife += 1
217
-        if self.FSM.stateLife == 2:
253
+        
254
+        if self.FSM.stateLife > self.lerp_len:
255
+            #pass
218 256
             self.FSM.owner.manager.walkers_active.remove(self.FSM.owner)
219
-            self.FSM.owner.obj.suspendDynamics()
220
-            self.FSM.owner.obj.suspendPhysics()
257
+            if self.FSM.owner.start_empty.type == 'corner':
258
+                self.FSM.owner.obj.children['npc'].stopAction(1)
259
+            else:
260
+                self.FSM.owner.obj.children['npc'].playAction('npc_sit', 1,90, layer=1, play_mode=0, speed=.5, blendin=10)
261
+
262
+        else:
263
+
264
+            l = self.s_p.lerp(self.e_p, (self.FSM.stateLife / self.lerp_len))
265
+            o = self.s_o.lerp(self.e_o, (self.FSM.stateLife / self.lerp_len))
266
+            #self.FSM.owner.obj.worldPosition.x = lerp()
267
+            self.FSM.owner.obj.worldPosition.x = l.x
268
+            self.FSM.owner.obj.worldPosition.y = l.y
269
+            self.FSM.owner.obj.worldOrientation = o
270
+        #     v = self.FSM.owner.obj.getVectTo(self.FSM.owner.target.obj.worldPosition)[1]
271
+        #     v.z = 0
272
+        #     self.FSM.owner.obj.alignAxisToVect(v, 0, .15)
273
+        #     align_to_road(self.FSM.owner)
274
+
275
+
276
+        #     print('linvel', self.FSM.owner.obj.linearVelocity)
277
+        #     if self.FSM.owner.obj.linearVelocity.x < self.FSM.owner.speed_targ:
278
+                
279
+        #         self.FSM.owner.obj.applyForce([self.FSM.owner.speed_inc, 0, 0], True)
280
+
281
+        # if self.FSM.stateLife == 360:
282
+        #     #self.FSM.owner.manager.walkers_active.remove(self.FSM.owner)
283
+        #     pass
284
+        #     #self.FSM.owner.obj.suspendDynamics()
285
+        #     #self.FSM.owner.obj.suspendPhysics()
221 286
     def Exit(self):
222 287
         pass
223 288
 
@@ -243,7 +308,7 @@ class NavigateToTarget(State):
243 308
         apply_gas(self.FSM.owner)
244 309
         walk_anim(self.FSM.owner)
245 310
 
246
-        if self.FSM.stateLife > 30 * 180 * 3:
311
+        if self.FSM.stateLife > 30 * 180 * 2:
247 312
             self.FSM.ToTransition('toEnterParallelPark')
248 313
 
249 314
     def Exit(self):
@@ -289,3 +354,110 @@ class RequestPath(State):
289 354
 
290 355
     def Exit(self):
291 356
         pass
357
+
358
+#====================================  
359
+
360
+class HitBySkater(State):
361
+    def __init__(self,FSM):
362
+        super(HitBySkater, self).__init__(FSM)    
363
+        
364
+    def Enter(self):
365
+        self.FSM.stateLife = 1
366
+
367
+        #self.FSM.owner.target, self.FSM.owner.path = find_new_parking(self.FSM.owner)
368
+        #self.FSM.owner.path_index = 0
369
+        self.FSM.owner.obj.children['npc'].playAction('npc_ran_into', 1,50, layer=1, play_mode=0, speed=.5, blendin=10) 
370
+        super(HitBySkater, self).Enter()        
371
+        
372
+    def Execute(self):
373
+        self.FSM.stateLife += 1
374
+        #print('doing hit state')
375
+        dict = bge.logic.globalDict
376
+        v = self.FSM.owner.obj.getVectTo(dict['cc'])[1]
377
+        v.z = 0
378
+        self.FSM.owner.obj.alignAxisToVect(v, 0, .05)
379
+        if self.FSM.stateLife == (50 * 2):
380
+            self.FSM.owner.obj.children['npc'].playAction('npc_argue', 1,210, layer=1, play_mode=1, speed=.5, blendin=10) 
381
+        if self.FSM.stateLife > ((50 + 210) * 2):    
382
+            self.FSM.ToTransition('toEnterParallelPark')
383
+            self.FSM.owner.obj.children['npc'].playAction('npc_walk', 1,30, layer=1, play_mode=1, speed=.5, blendin=10) 
384
+    def Exit(self):
385
+        pass
386
+
387
+#====================================  
388
+
389
+class WalkingHitBySkater(State):
390
+    def __init__(self,FSM):
391
+        super(WalkingHitBySkater, self).__init__(FSM)    
392
+        
393
+    def Enter(self):
394
+        self.FSM.stateLife = 1
395
+
396
+        #self.FSM.owner.target, self.FSM.owner.path = find_new_parking(self.FSM.owner)
397
+        #self.FSM.owner.path_index = 0
398
+        self.FSM.owner.obj.children['npc'].playAction('npc_ran_into', 1,50, layer=1, play_mode=0, speed=.5, blendin=10) 
399
+        super(WalkingHitBySkater, self).Enter()        
400
+        
401
+    def Execute(self):
402
+        self.FSM.stateLife += 1
403
+        #print('doing hit state')
404
+        #self.FSM.owner.arm.playAction('npc_walk', 1,30, layer=1, play_mode=0, speed=.5) 
405
+        dict = bge.logic.globalDict
406
+        v = self.FSM.owner.obj.getVectTo(dict['cc'])[1]
407
+        v.z = 0
408
+        self.FSM.owner.obj.alignAxisToVect(v, 0, .05)
409
+        if self.FSM.stateLife == (50 * 2):
410
+            self.FSM.owner.obj.children['npc'].playAction('npc_argue', 1,210, layer=1, play_mode=1, speed=.5, blendin=10) 
411
+        if self.FSM.stateLife > ((50 + 210) * 2):
412
+            print('resume path')
413
+            self.FSM.ToTransition('toNavigateToTarget')
414
+    def Exit(self):
415
+        pass
416
+
417
+
418
+#====================================  
419
+
420
+class Dance1(State):
421
+    def __init__(self,FSM):
422
+        super(Dance1, self).__init__(FSM)    
423
+        
424
+    def Enter(self):
425
+        self.FSM.stateLife = 1
426
+
427
+        #self.FSM.owner.target, self.FSM.owner.path = find_new_parking(self.FSM.owner)
428
+        #self.FSM.owner.path_index = 0
429
+        self.FSM.owner.obj.children['npc'].playAction('npc_dance_1', 10,110, layer=1, play_mode=1, speed=.5, blendin=10) 
430
+        super(Dance1, self).Enter()        
431
+        
432
+    def Execute(self):
433
+        self.FSM.stateLife += 1
434
+        if self.FSM.stateLife > 1200:
435
+            #self.FSM.owner.obj.worldPosition = self.FSM.owner.target.obj.worldPosition
436
+            self.FSM.owner.start_empty = self.FSM.owner.target
437
+            self.FSM.ToTransition('toGoToSleep')
438
+            #self.FSM.ToTransition('toEnterParallelPark')
439
+    def Exit(self):
440
+        pass
441
+
442
+#====================================  
443
+
444
+class GoToSleep(State):
445
+    def __init__(self,FSM):
446
+        super(GoToSleep, self).__init__(FSM)    
447
+        
448
+    def Enter(self):
449
+        self.FSM.stateLife = 1
450
+
451
+        self.FSM.owner.obj.children['npc'].playAction('npc_dance_1', 10,110, layer=1, play_mode=1, speed=.5, blendin=10) 
452
+        super(GoToSleep, self).Enter()        
453
+        
454
+    def Execute(self):
455
+        self.FSM.stateLife += 1
456
+        if self.FSM.owner.start_empty.type == 'corner':
457
+            self.FSM.owner.obj.children['npc'].playAction('npc_dance_1', 1,1, layer=1, play_mode=1, speed=.5, blendin=20) 
458
+            if self.FSM.stateLife > 30:
459
+                self.FSM.ToTransition('toRequestPath')    
460
+        if self.FSM.owner.start_empty.type == 'bench':
461
+            pass
462
+    def Exit(self):
463
+        pass

+ 4
- 2
scripts/astar.py View File

@@ -99,7 +99,8 @@ class Astar:
99 99
         self.life += 1
100 100
         if self.state == 'searching':
101 101
             self.search()
102
-            if self.life > 5000:
102
+            if self.life > 3000:
103
+                print('path failed', self.current_searcher)
103 104
                 self.state = 'idle'
104 105
         else:
105 106
             self.update_queue()        
@@ -120,7 +121,8 @@ class Astar:
120 121
             if breaker > 2000:
121 122
                 break
122 123
         results.reverse()
123
-        self.messenger.dispatch('path found', ['found path for object', self.current_searcher, results])
124
+        self.messenger.dispatch('path found', ['path', self.current_searcher, results])
125
+        print('path found', self.current_searcher)
124 126
 
125 127
     def smallest_f(self):
126 128
         if len(self.open) > 1:

+ 3
- 3
scripts/cars.py View File

@@ -39,7 +39,7 @@ def add_car(self, x):
39 39
 	car.worldPosition.z += .8
40 40
 	car.applyMovement([0, -6, 0], True)
41 41
 	car.suspendDynamics()
42
-	car.suspendPhysics()	
42
+	#car.suspendPhysics()	
43 43
 	car.name = 'lcar' + str(len(self.manager.cars))
44 44
 	color = random.choice(car_colors)
45 45
 	car.color = color
@@ -94,8 +94,8 @@ class CarManager:
94 94
 		self.pub = observer.Publisher(['path found', 'working'])
95 95
 		self.navmesh2 =  astar.Astar('nav_points', self.pub)
96 96
 		self.cars = []
97
-		self.max_cars = 14
98
-		self.max_active = 9
97
+		self.max_cars = 6
98
+		self.max_active = 4
99 99
 		self.targets = []
100 100
 		self.target_loc = None
101 101
 		self.parking_spots = get_parking_spots()

+ 9
- 4
scripts/controller2.py View File

@@ -2129,7 +2129,7 @@ def main():
2129 2129
 
2130 2130
             if grindSound == 'rail':
2131 2131
                 cam['sndmgr'].queue_sound(['grind_rail', own, cam, v, p]) 
2132
-            elif grindSound == 'cement':
2132
+            elif grindSound == 'concrete':
2133 2133
                 cam['sndmgr'].queue_sound(['grind_cement', own, cam, v, p])     
2134 2134
 
2135 2135
             # if grindSound == "concrete":
@@ -4351,7 +4351,7 @@ def main():
4351 4351
             own.alignAxisToVect([0.0, 0.0, 1.0], 2, .05)  
4352 4352
         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)):
4353 4353
             own['vert'] = 1
4354
-            #print('vert hit')
4354
+            print('vert hit')
4355 4355
 
4356 4356
             if 'spine' in localRay_v[0] and lUD < -.04:
4357 4357
                 print('spine hit!!!!!', lUD)
@@ -4373,12 +4373,14 @@ def main():
4373 4373
                     #own.applyMovement((0,0,((.4 - (localHitDist) * .1))), True)
4374 4374
                     #own.applyMovement((0, 0, (.3 - localHitDist)), True)
4375 4375
                     own.applyMovement((0, 0, (.4 - localHitDist)), True)
4376
-                    #print('moving vert ray')
4376
+                    print('moving vert ray')
4377 4377
                     if localRay_v[2] != [0, 0, -1] and grindHit == 0:
4378 4378
                     #if localRay_v[2] != [0,0,-1]:
4379 4379
                         own.alignAxisToVect(localRay_v[2], 2, .4)
4380 4380
                         #own.alignAxisToVect(localRay_v[2], 2, .05)
4381 4381
                         aligned = True
4382
+            else:
4383
+                print('doing nothing')            
4382 4384
         #print(own['lGobj'], 'lGobj')                         
4383 4385
 
4384 4386
 
@@ -4415,7 +4417,10 @@ def main():
4415 4417
         own['grindType'] = ''
4416 4418
 
4417 4419
     
4418
-
4420
+    if cont.sensors['npc'].triggered:
4421
+        cam['walker_manager'].pub.dispatch('path found', ['hit', own, cont.sensors['npc'].hitObject])
4422
+        
4423
+        #print('npc hit')
4419 4424
 
4420 4425
 
4421 4426
     if own['actionState'] in ['frontside_grab_out', 'backside_grab_out', 'frontside_nose_grab_out', 'frontside_tail_grab_out', 'backside_nose_grab_out', 'backside_tail_grab_out', 'reg_walk_air_out', 'reg_air-walk_air', 'reg_judo_out', 'reg_frigid_out', 'reg_fsonefoot_out', 'reg_onefoot_out', 'reg_airwalk_out'] and own['requestAction'] in ['fak_land', 'reg_land']:

+ 19
- 0
scripts/main.py View File

@@ -1,3 +1,22 @@
1 1
 #main game loop
2 2
 
3
+import Startup
4
+import Settings
5
+#import inputs
6
+
3 7
 def main(cont):
8
+	if 'minited' not in cont.owner:
9
+		cont.owner['minited'] = True
10
+
11
+		Startup.main(cont)
12
+		Settings.readSettings()
13
+
14
+		#Settings.loadlevel(cont)
15
+
16
+#***********************************
17
+#main loop
18
+#***********************************
19
+	#inputs.main(cont)
20
+
21
+		
22
+

+ 2
- 1
scripts/scene_init.py View File

@@ -23,6 +23,7 @@ def main():
23 23
         objList = scene.objects
24 24
 
25 25
         parent = objList["control_cube.002"]
26
+        dict['cc'] = parent
26 27
         # combine child's shape with parent's
27 28
         compound = True
28 29
         obj = scene.objects['Char4']
@@ -169,7 +170,7 @@ def main():
169 170
                     material_list.append(material.name)
170 171
 
171 172
 
172
-
173
+        scene.objects['camposEmpty'].applyRotation([.3, .3, 0], True)
173 174
         material_list = set(material_list)
174 175
         print('number of materials:', len(material_list))
175 176
       

+ 49
- 19
scripts/walkers.py View File

@@ -6,6 +6,8 @@ import observer
6 6
 
7 7
 car_colors = [[.2,.01,.01,1], [.5,.5,.4,1], [.005,.01,.015,1], [.005, .1, 0.003, 1], [.1, .1, .1, 1]]
8 8
 
9
+npcs = ['carlos', 'maria', 'denise', 'charlie']
10
+
9 11
 def idle_run_check(self):
10 12
 	output = False
11 13
 	for x in bge.logic.getCurrentScene().objects:
@@ -22,6 +24,8 @@ def get_idle_spots():
22 24
 	for obj in bge.logic.getCurrentScene().objects:
23 25
 		if 'idle_spot' in obj.name:
24 26
 			ps = IdleSpot(obj, 'available')
27
+			if 'corner' in obj:
28
+				ps.type = 'corner'
25 29
 			op.append(ps)
26 30
 	print('&&&&&& idle spots')
27 31
 	print(op)		
@@ -36,13 +40,18 @@ def get_intersections():
36 40
 
37 41
 def add_walker(self, x):
38 42
 	print(x.obj.worldPosition, '--walker here')
39
-	walker = bge.logic.getCurrentScene().addObject('larryCube', x.obj, 0)
43
+	#walker = bge.logic.getCurrentScene().addObject('larryCube', x.obj, 0)
44
+	#walker = bge.logic.getCurrentScene().addObject('npcCube', x.obj, 0)
45
+	choice = random.choice(npcs)
46
+	walker = bge.logic.getCurrentScene().addObject(choice, x.obj, 0)
40 47
 	print(walker.worldPosition)
41 48
 	
42 49
 	#walker.worldPosition = x.obj.worldPosition
43 50
 	walker.worldOrientation = x.obj.worldOrientation
44 51
 	walker.worldPosition.z += 2.8
45 52
 	walker.name = 'lwalker' + str(len(self.manager.walkers))
53
+	walker.childrenRecursive['shirt'].color = [random.random(),random.random(),random.random(),1]
54
+	walker['npc'] = True
46 55
 	x.status = 'in_use'
47 56
 
48 57
 	return walker
@@ -53,6 +62,7 @@ class IdleSpot:
53 62
 	def __init__(self, obj, status):
54 63
 		self.obj = obj
55 64
 		self.status = status
65
+		self.type = None
56 66
 
57 67
 class Walker:
58 68
 	def __init__(self, own, start_empty):
@@ -64,12 +74,13 @@ class Walker:
64 74
 		self.speed_inc = 100
65 75
 		self.FSM = FSM.WalkerFSM(self)
66 76
 		self.active = False
67
-		self.target = None
77
+		self.target = start_empty
68 78
 		self.lane_point = self.obj.worldPosition
69 79
 		self.last_lane_point = self.obj.worldPosition
70 80
 		self.path = None
71 81
 		self.path_index = 0
72 82
 		self.path_display = []
83
+		self.cla = None
73 84
 		self.manager.pub.register("path found", self)
74 85
 		#self.obj.worldPosition = self.start_empty.obj.worldPosition
75 86
 
@@ -78,19 +89,35 @@ class Walker:
78 89
 		self.life += 1
79 90
 
80 91
 	def ReceiveMessage(self, message):
81
-		if self == message[1]:
82
-			self.path = message[2]
83
-			self.FSM.FSM.ToTransition('toExitParallelPark')
92
+		#print(message[0])
93
+		if message[0] == 'path':
94
+			if self == message[1]:
95
+				self.path = message[2]
96
+				self.FSM.FSM.ToTransition('toExitParallelPark')
97
+				#print('path got')
98
+		elif message[0] == 'hit':
99
+			if self.obj == message[2]:
100
+				#print('something was hit')
101
+				active_ = False
102
+				if self in self.manager.walkers_active:
103
+					active_ = True
104
+					#print(self.FSM.FSM.curState.__class__.__name__, 'name')
105
+					if self.FSM.FSM.curState.__class__.__name__ == 'NavigateToTarget':
106
+						self.FSM.FSM.ToTransition('toWalkingHitBySkater')
107
+				else:
108
+					self.manager.walkers_active.append(self)
109
+					self.FSM.FSM.ToTransition('toHitBySkater')
110
+				#print('i was hit', message[2], active_)		
84 111
 
85 112
 class WalkerManager:
86 113
 	def __init__(self, own):
87 114
 		self.parent = own
88
-		self.navmesh =None
115
+		self.navmesh = None
89 116
 		self.pub = observer.Publisher(['path found', 'working'])
90 117
 		self.navmesh2 =  astar.Astar('walker_nav_points', self.pub)
91 118
 		self.walkers = []
92
-		self.max_walkers = 7
93
-		self.max_active = 6
119
+		self.max_walkers = 16
120
+		self.max_active = 8
94 121
 		self.targets = []
95 122
 		self.target_loc = None
96 123
 		self.idle_spots = get_idle_spots()
@@ -103,7 +130,7 @@ class WalkerManager:
103 130
 
104 131
 	def load_walkers(self):
105 132
 		iter_ = 0
106
-		if 'larryCube' in bge.logic.getCurrentScene().objectsInactive:
133
+		if npcs[0] in bge.logic.getCurrentScene().objectsInactive:
107 134
 			start_choices = self.idle_spots.copy()
108 135
 			while len(self.walkers) < self.max_walkers:
109 136
 				#get starting position
@@ -111,6 +138,7 @@ class WalkerManager:
111 138
 				start_choices.remove(start_choice)
112 139
 
113 140
 				walker_ = Walker(self, start_choice)
141
+				#walker_.cla = self
114 142
 				self.walkers.append(walker_)
115 143
 
116 144
 			for x in self.idle_spots:
@@ -119,16 +147,17 @@ class WalkerManager:
119 147
 			self.walkers_loaded = True	
120 148
 
121 149
 		else:
122
-			mainDir = bge.logic.expandPath("//npc_walkers/")
123
-			npc = 'larry'
124
-			fileName = mainDir + str(npc) + '.blend'    
125
-			path = bge.logic.expandPath(fileName)
126
-			print('loading npc')
127
-			try:
128
-				bge.logic.LibLoad(fileName, 'Scene', load_actions=True) 
129
-				print('larry loaded')
130
-			except Exception as e:
131
-				print('loading', fileName, 'failed', e)   
150
+			for obj in npcs:
151
+				mainDir = bge.logic.expandPath("//npc_walkers/")
152
+				npc = obj
153
+				fileName = mainDir + str(npc) + '.blend'    
154
+				path = bge.logic.expandPath(fileName)
155
+				print('loading npc')
156
+				try:
157
+					bge.logic.LibLoad(fileName, 'Scene', load_actions=True) 
158
+					print(' loaded', obj)
159
+				except Exception as e:
160
+					print('loading', fileName, 'failed', e)   
132 161
 
133 162
 	def activator_check(self):
134 163
 		if len(self.walkers_active) < self.max_active:
@@ -141,6 +170,7 @@ class WalkerManager:
141 170
 			walker.active = True
142 171
 			walker.obj.worldPosition = walker.start_empty.obj.worldPosition
143 172
 			walker.FSM.FSM.ToTransition('toRequestPath')
173
+			#print('activating walker')
144 174
 
145 175
 	def update(self):
146 176
 		self.life += 1

+ 2
- 2
shuvit.blend View File

@@ -1,3 +1,3 @@
1 1
 version https://git-lfs.github.com/spec/v1
2
-oid sha256:9ccdd0f29122e3b023a3de878c673f17855aa3031fd241a18a4a38e9f2c51263
3
-size 113395184
2
+oid sha256:54017e8b853bf6bb08847789140d3e26cfc38ec713a3efc6c4b36a6d8e23baaf
3
+size 120713088

+ 3
- 0
textures/M_Trousers_02.png View File

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

+ 3
- 0
textures/M_Trousers_02_NRM.png View File

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

+ 3
- 0
textures/afro_diffuse.png View File

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

+ 3
- 0
textures/brown_eye.png View File

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

+ 3
- 0
textures/eyebrow001.png View File

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

+ 3
- 0
textures/female_casualsuit01_diffuse.png View File

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

+ 3
- 0
textures/female_casualsuit01_diffuse2.png View File

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

+ 3
- 0
textures/female_casualsuit01_normal.png View File

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

+ 3
- 0
textures/lightblue_eye.png View File

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

+ 3
- 0
textures/male_casualsuit06_diffuse.png View File

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

+ 3
- 0
textures/male_casualsuit06_normal.png View File

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

+ 3
- 0
textures/middleage_darkskinned_male_diffuse.png View File

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

+ 3
- 0
textures/old_lightskinned_male_diffuse2.png View File

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

+ 3
- 0
textures/ponytail01_diffuse.png View File

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

+ 3
- 0
textures/shoes05_diffuse.png View File

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

+ 3
- 0
textures/short01_diffuse.png View File

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

+ 3
- 0
textures/wb_normals.png View File

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

+ 3
- 0
textures/wb_tex3.png View File

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

+ 3
- 0
textures/young_darkskinned_female_diffuse.png View File

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

+ 2
- 2
textures/young_lightskinned_female_diffuse.png View File

@@ -1,3 +1,3 @@
1 1
 version https://git-lfs.github.com/spec/v1
2
-oid sha256:9e2fa4ab993dd938ba896bb98848bd65346500c4c0a07d8789d2f1e14bb3dd7f
3
-size 4405289
2
+oid sha256:0c2d18718e11102038b8b721ff42945eb0ac4deb9f4aa1d1d3436a4cb31cab86
3
+size 1175671

Loading…
Cancel
Save