Browse Source

6-15-19 cleaning

shuvit 4 years ago
parent
commit
20f47fc993

+ 4
- 4
scripts/Settings.py View File

29
 def readChar():
29
 def readChar():
30
     mainDir = GameLogic.expandPath("//characters/")    
30
     mainDir = GameLogic.expandPath("//characters/")    
31
     fileName = mainDir + dict['character'] + ".ini"
31
     fileName = mainDir + dict['character'] + ".ini"
32
-    print('loading character settings', fileName)
32
+    #print('loading character settings', fileName)
33
     char_config = ConfigObj(fileName, interpolation=True)
33
     char_config = ConfigObj(fileName, interpolation=True)
34
     
34
     
35
     
35
     
45
                 except:
45
                 except:
46
                     pass
46
                     pass
47
         dict[key] = value  
47
         dict[key] = value  
48
-        print(key, value)      
48
+        #print(key, value)      
49
     
49
     
50
     
50
     
51
     char_config.walk(to_dict2, char_config)
51
     char_config.walk(to_dict2, char_config)
90
     resx = int(dict["resx"])
90
     resx = int(dict["resx"])
91
     resy = int(dict["resy"])
91
     resy = int(dict["resy"])
92
     fullscreen = bge.render.getFullScreen()
92
     fullscreen = bge.render.getFullScreen()
93
-    print("fullscreen = ", fullscreen)
93
+    #print("fullscreen = ", fullscreen)
94
     if fullscreen != True:
94
     if fullscreen != True:
95
         if dict['fullscreen_on'] == 1:
95
         if dict['fullscreen_on'] == 1:
96
             bge.render.setFullScreen(True)
96
             bge.render.setFullScreen(True)
99
             bge.render.setFullScreen(False) 
99
             bge.render.setFullScreen(False) 
100
             
100
             
101
     bge.render.setWindowSize(resx, resy)         
101
     bge.render.setWindowSize(resx, resy)         
102
-    print("resolution = ", resx, resy)       
102
+    #print("resolution = ", resx, resy)       
103
         
103
         
104
 def loadlevel():
104
 def loadlevel():
105
     import GameLogic
105
     import GameLogic

BIN
scripts/__pycache__/Settings.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__/scene_init.cpython-36.pyc View File


+ 3
- 3
scripts/actionsFSMlist.py View File

1646
 	#player armature action name, start, end frames
1646
 	#player armature action name, start, end frames
1647
 	'reg_5050', 1, 20,
1647
 	'reg_5050', 1, 20,
1648
 	#deck action name, start, end frames  
1648
 	#deck action name, start, end frames  
1649
-	'b_reg', 1, 20,
1649
+	'b_reg', 1, 30,
1650
 	#layer, speed, mode (0 = play, 1 = loop), blendin
1650
 	#layer, speed, mode (0 = play, 1 = loop), blendin
1651
-	1, .5, 0, 10,
1651
+	1, 1, 0, 10,
1652
 	#intro, length
1652
 	#intro, length
1653
 	None, 0,
1653
 	None, 0,
1654
 	#exits
1654
 	#exits
1660
 
1660
 
1661
 reg_5050 = a_class(
1661
 reg_5050 = a_class(
1662
 	#player armature action name, start, end frames
1662
 	#player armature action name, start, end frames
1663
-	'reg_5050', 20, 50,
1663
+	'reg_5050', 30, 60,
1664
 	#deck action name, start, end frames  
1664
 	#deck action name, start, end frames  
1665
 	'b_reg', 1, 30,
1665
 	'b_reg', 1, 30,
1666
 	#layer, speed, mode (0 = play, 1 = loop), blendin
1666
 	#layer, speed, mode (0 = play, 1 = loop), blendin

+ 15
- 13
scripts/birds.py View File

26
                 own['bird_list'].append(x)
26
                 own['bird_list'].append(x)
27
                 
27
                 
28
     def do_birds(scene, own, cont):
28
     def do_birds(scene, own, cont):
29
-        num = random.randint(0,2)
30
-        if own['life'] % 50 == 0 and num == 1:
31
-            #print('add bird')
32
-            top = len(own['bird_list']) - 1
33
-            start = random.randint(0, top)
34
-            end = start
35
-            while end == start:
36
-                end = random.randint(0, top)
37
-            obj = scene.addObject('bird_cont', own['bird_list'][start], 0)                
38
-            obj['start'] = own['bird_list'][start]
39
-            obj['end'] = own['bird_list'][end]
40
-            obj.worldPosition = obj['start'].worldPosition
41
-            #print(obj['start'], obj['end'])
29
+        
30
+        if own['life'] % 50 == 0:
31
+            num = random.randint(0,2)
32
+            if num == 1:
33
+                #print('add bird')
34
+                top = len(own['bird_list']) - 1
35
+                start = random.randint(0, top)
36
+                end = start
37
+                while end == start:
38
+                    end = random.randint(0, top)
39
+                obj = scene.addObject('bird_cont', own['bird_list'][start], 0)                
40
+                obj['start'] = own['bird_list'][start]
41
+                obj['end'] = own['bird_list'][end]
42
+                obj.worldPosition = obj['start'].worldPosition
43
+                #print(obj['start'], obj['end'])
42
             
44
             
43
     def life(own):
45
     def life(own):
44
         if 'life' in own:
46
         if 'life' in own:

+ 9
- 8
scripts/camera.py View File

4
 from mathutils import *
4
 from mathutils import *
5
 scene = bge.logic.getCurrentScene()
5
 scene = bge.logic.getCurrentScene()
6
 import camFSM
6
 import camFSM
7
-import birds
8
 
7
 
9
 def main(cont):
8
 def main(cont):
10
     #camFSM.main(cont)
9
     #camFSM.main(cont)
44
     cam3 = scene.objects['followcam']
43
     cam3 = scene.objects['followcam']
45
     camList = scene.cameras
44
     camList = scene.cameras
46
     freecam = camList["freecam"]
45
     freecam = camList["freecam"]
47
-    dict['camera'] = cam1
48
 
46
 
49
     if 'init' not in own:
47
     if 'init' not in own:
50
         own['init'] = 1
48
         own['init'] = 1
62
         cam.height = dict['cam_height']
60
         cam.height = dict['cam_height']
63
         dict['cam_state'] = 'walking'
61
         dict['cam_state'] = 'walking'
64
         controlcube['ragdoll_active'] = False
62
         controlcube['ragdoll_active'] = False
63
+        dict['camera'] = cam1
65
     acam = scene.active_camera
64
     acam = scene.active_camera
66
 
65
 
67
     def get_cam_state():
66
     def get_cam_state():
92
 
91
 
93
         if down.triggered == False and LAST_GRIND == False and cam_moved == 0 and walk == 0:
92
         if down.triggered == False and LAST_GRIND == False and cam_moved == 0 and walk == 0:
94
             camempty['hitdown'] = False
93
             camempty['hitdown'] = False
95
-            if cam_height > (cam_def_height + .06) and zdist > -.2 and raised == 0:
94
+            if cam_height > (cam_def_height + .08) and zdist > -.2 and raised == 0:
96
                 cam.height = cam_height - .02
95
                 cam.height = cam_height - .02
96
+                print('raising a')
97
         if cam_height < -.6 and cam_moved == 0 and LAST_GRIND == False and zdist > -.2 and raised == 0 and walk == 0:
97
         if cam_height < -.6 and cam_moved == 0 and LAST_GRIND == False and zdist > -.2 and raised == 0 and walk == 0:
98
             cam_height = .1
98
             cam_height = .1
99
+            print('raising b')
99
         if LAST_GRIND == True and walk == 0:
100
         if LAST_GRIND == True and walk == 0:
100
             if cam.height < -.5 or zdist < -.2:
101
             if cam.height < -.5 or zdist < -.2:
101
                 cam.height = cam.height + .013
102
                 cam.height = cam.height + .013
103
+                print('raising c')
102
             if cam.height >= -.5 and not down.triggered:
104
             if cam.height >= -.5 and not down.triggered:
103
                 pass
105
                 pass
104
 
106
 
148
         if hit[0]:
150
         if hit[0]:
149
             #if hitobj != control and walk == 0 and 'vert' not in hit[0] and 'ground' in hit[0] and controlcube['ragdoll_active'] == False:
151
             #if hitobj != control and walk == 0 and 'vert' not in hit[0] and 'ground' in hit[0] and controlcube['ragdoll_active'] == False:
150
             if hitobj != control and walk == 0 and 'vert' not in hit[0] and 'ground' in hit[0]:
152
             if hitobj != control and walk == 0 and 'vert' not in hit[0] and 'ground' in hit[0]:
151
-                cam.damping = .0
153
+                cam.damping = .01
152
                 if cam.height < 2:
154
                 if cam.height < 2:
153
                     cam.height = cam_height + .1
155
                     cam.height = cam_height + .1
154
                     cam.max = cam.max - .2
156
                     cam.max = cam.max - .2
155
-                    #print('small move')
157
+                    print('small move', cam.height, dict['cam_height'])
156
                 elif cam.height >= 2 and cam.height < 4:
158
                 elif cam.height >= 2 and cam.height < 4:
157
                     cam.height = cam_height + .05
159
                     cam.height = cam_height + .05
158
                     cam.max = cam.max - .05
160
                     cam.max = cam.max - .05
159
-                    #print('big move')
161
+                    print('big move')
160
 
162
 
161
     if dict['menu_idle_timer'] > 300:
163
     if dict['menu_idle_timer'] > 300:
162
         move_len = 2048
164
         move_len = 2048
358
             pass
360
             pass
359
     set_lens_dist()        
361
     set_lens_dist()        
360
     get_cam_state()
362
     get_cam_state()
361
-    camFSM.main(cont)
362
-    birds.main(cont, scene) 
363
+    camFSM.main(cont)

+ 2
- 2
scripts/colors.py View File

52
     #print(dict['shirt_color'])
52
     #print(dict['shirt_color'])
53
     scol = [dict['shirt_color_r'], dict['shirt_color_g'], dict['shirt_color_b'], 1]
53
     scol = [dict['shirt_color_r'], dict['shirt_color_g'], dict['shirt_color_b'], 1]
54
     deckC = [dict['deck_color_r'], dict['deck_color_g'], dict['deck_color_b'], 1]
54
     deckC = [dict['deck_color_r'], dict['deck_color_g'], dict['deck_color_b'], 1]
55
-    print(scol)
55
+    #print(scol)
56
     shirt.color = scol
56
     shirt.color = scol
57
     deck.color = deckC
57
     deck.color = deckC
58
     throw_deck.color = deckC
58
     throw_deck.color = deckC
164
         fileName2 = mainDir + 'textures//shirt//*.png'  
164
         fileName2 = mainDir + 'textures//shirt//*.png'  
165
     shirtList = glob.glob(fileName2)
165
     shirtList = glob.glob(fileName2)
166
     dict['shirtList'] = shirtList  
166
     dict['shirtList'] = shirtList  
167
-    print(shirtList, 'shirtList')
167
+    #print(shirtList, 'shirtList')
168
     ID = texture.materialID(shirt, 'MAshirt')
168
     ID = texture.materialID(shirt, 'MAshirt')
169
     shirt_texture = texture.Texture(shirt, ID)
169
     shirt_texture = texture.Texture(shirt, ID)
170
     new_source2 = texture.ImageFFmpeg(shirtList[dict["shirt_logo"]])
170
     new_source2 = texture.ImageFFmpeg(shirtList[dict["shirt_logo"]])

+ 66
- 90
scripts/controller2.py View File

4510
                 own['ragdoll_out'] = 0
4510
                 own['ragdoll_out'] = 0
4511
                 stre = 0
4511
                 stre = 0
4512
                 
4512
                 
4513
-
4514
             armature = scene.objects['Char4']
4513
             armature = scene.objects['Char4']
4515
             for const in armature.constraints:
4514
             for const in armature.constraints:
4516
                 #print(const, 'const')
4515
                 #print(const, 'const')
4517
                 if ('rd_cl' in str(const) or 'rd_cr' in str(const)):
4516
                 if ('rd_cl' in str(const) or 'rd_cr' in str(const)):
4518
-                    #print(const, 'const', strength)
4519
                     const.enforce = stre  
4517
                     const.enforce = stre  
4520
 
4518
 
4521
 
4519
 
4522
 
4520
 
4521
+    def land_mod():
4522
+        if own['requestAction'] == 'reg_land':
4523
+            if land_overRideL == True:
4524
+                own['requestAction'] = 'reg_landL'
4525
+                print('requesting unbalanced land1')
4526
+                own['lland'] = own['requestAction']
4527
+            elif land_overRideR == True:
4528
+                own['requestAction'] = 'reg_landR'
4529
+                print('requesting unbalanced land2')
4530
+                own['lland'] = own['requestAction']
4531
+            elif land_overRideLb == True:
4532
+                own['requestAction'] = 'reg_landLb'
4533
+                print('requesting unbalanced land1b')
4534
+                own['lland'] = own['requestAction']
4535
+            elif land_overRideRb == True:
4536
+                own['requestAction'] = 'reg_landRb'
4537
+                print('requesting unbalanced land2b')
4538
+                own['lland'] = own['requestAction']
4539
+            else:
4540
+                own['lland'] = own['requestAction']    
4541
+
4542
+        if own['requestAction'] == 'fak_land':
4543
+            if land_overRideL == True:
4544
+                own['requestAction'] = 'fak_landL'
4545
+                print('requesting unbalanced landf1')
4546
+                own['lland'] = own['requestAction']
4547
+            elif land_overRideR == True:
4548
+                own['requestAction'] = 'fak_landR'
4549
+                print('requesting unbalanced landf2')
4550
+                own['lland'] = own['requestAction']
4551
+            elif land_overRideLb == True:
4552
+                own['requestAction'] = 'fak_landLb'
4553
+                print('requesting unbalanced landf1b')
4554
+                own['lland'] = own['requestAction']
4555
+            elif land_overRideRb == True:
4556
+                own['requestAction'] = 'fak_landRb'
4557
+                print('requesting unbalanced landf2b')
4558
+                own['lland'] = own['requestAction']
4559
+            else:
4560
+                own['lland'] = own['requestAction']   
4561
+
4562
+    def incline_action():
4563
+        own['ground_since'] = ground_since
4564
+        if own['rotz'] < .97:
4565
+            if own['requestAction'] == 'reg_roll':
4566
+                own['requestAction'] = 'reg_opos'
4567
+            if own['requestAction'] == 'reg_turnLeft':
4568
+                own['requestAction'] = 'reg_pump_left'
4569
+            if own['requestAction'] == 'reg_turnRight':
4570
+                own['requestAction'] = 'reg_pump_right'
4571
+
4572
+            if own['requestAction'] == 'fak_roll':
4573
+                own['requestAction'] = 'fak_opos'
4574
+            if own['requestAction'] == 'fak_turnLeft':
4575
+                own['requestAction'] = 'fak_pump_left'
4576
+            if own['requestAction'] == 'fak_turnRight':
4577
+                own['requestAction'] = 'fak_pump_right'        
4578
+
4523
     jump_Timer()
4579
     jump_Timer()
4524
     check_landing()
4580
     check_landing()
4525
     nextframe()
4581
     nextframe()
4541
     dropinRotate()
4597
     dropinRotate()
4542
     onboard()
4598
     onboard()
4543
     grind_but_align()
4599
     grind_but_align()
4600
+    land_mod()
4601
+    incline_action()
4544
     #ragdoll_out()
4602
     #ragdoll_out()
4545
     linvelx = own.getLinearVelocity(True)
4603
     linvelx = own.getLinearVelocity(True)
4546
     own["linvelx"] = linvelx.x
4604
     own["linvelx"] = linvelx.x
4579
     own['lastxBut_ground'] = xBut_ground
4637
     own['lastxBut_ground'] = xBut_ground
4580
     own["last_sel"] = own["sel"]
4638
     own["last_sel"] = own["sel"]
4581
     own["sel"] = bkBut
4639
     own["sel"] = bkBut
4582
-
4583
-    # if r_ground.triggered and own["jump_timer"] < 20:
4584
-    #     if 1 == 1:
4585
-    #         force2 = [0.0, 0, dict['antibounce']]
4586
-
4587
-    #         gdist = ((own.worldPosition.z - r_ground.hitPosition[2]))
4588
-    #         if gdist < .2875 and gdist > .1:
4589
-    #             move = (.2875 - gdist)*.33
4590
-    #             if move > 0:
4591
-    #                 own.worldPosition.z = own.worldPosition.z + move
4592
-    #             else:
4593
-    #                 own.worldPosition.z = own.worldPosition.z - move
4594
-    #             own.linearVelocity.z = 0
4595
-
4596
-    #             friction = .998
4597
-    #             own.linearVelocity.x *= friction
4598
-    #     else:
4599
-    #         gdist = ((own.worldPosition.z - r_ground.hitPosition[2]))
4600
-    #         if gdist < .2875 and gdist > .1:
4601
-    #             move = (.2875 - gdist)*.4
4602
-    #             if move > 0:
4603
-    #                 own.worldPosition.z = own.worldPosition.z + move
4604
-    #             else:
4605
-    #                 own.worldPosition.z = own.worldPosition.z - move
4606
-    #             own.linearVelocity.z = 0
4640
+    dict['walk'] = 0
4607
 
4641
 
4608
     Axis = 2
4642
     Axis = 2
4609
     Distance = -10
4643
     Distance = -10
4636
             own.applyMovement((0, 0, (.295 - (localHitDist))), True)
4670
             own.applyMovement((0, 0, (.295 - (localHitDist))), True)
4637
             #own.applyMovement((0, 0, (.32 - (localHitDist))), True)
4671
             #own.applyMovement((0, 0, (.32 - (localHitDist))), True)
4638
             #own.applyMovement((0, 0, (.5 - localHitDist)), True)
4672
             #own.applyMovement((0, 0, (.5 - localHitDist)), True)
4639
-            print('moving new ray a')
4673
+            #print('moving new ray a')
4640
             #if localRay[2] != [0, 0, -1] and grindHit == 0:
4674
             #if localRay[2] != [0, 0, -1] and grindHit == 0:
4641
             if localRay[2] != [0, 0, -1]:    
4675
             if localRay[2] != [0, 0, -1]:    
4642
                 #own.alignAxisToVect(localRay[2], 2, .25)
4676
                 #own.alignAxisToVect(localRay[2], 2, .25)
4750
     if (grindDar == False and onGround and own['grindTouch'] == False) or own['jump_timer'] > 40:
4784
     if (grindDar == False and onGround and own['grindTouch'] == False) or own['jump_timer'] > 40:
4751
         own['grindType'] = ''
4785
         own['grindType'] = ''
4752
 
4786
 
4753
-    dict['walk'] = 0
4787
+    
4754
 
4788
 
4755
 
4789
 
4756
 
4790
 
4763
 
4797
 
4764
 
4798
 
4765
 
4799
 
4766
-    if own['requestAction'] == 'reg_land':
4767
-        print('*****************ra', land_overRideL, land_overRideR, land_overRideLb, land_overRideRb)
4768
-        if land_overRideL == True:
4769
-            own['requestAction'] = 'reg_landL'
4770
-            print('requesting unbalanced land1')
4771
-            own['lland'] = own['requestAction']
4772
-        elif land_overRideR == True:
4773
-            own['requestAction'] = 'reg_landR'
4774
-            print('requesting unbalanced land2')
4775
-            own['lland'] = own['requestAction']
4776
-        elif land_overRideLb == True:
4777
-            own['requestAction'] = 'reg_landLb'
4778
-            print('requesting unbalanced land1b')
4779
-            own['lland'] = own['requestAction']
4780
-        elif land_overRideRb == True:
4781
-            own['requestAction'] = 'reg_landRb'
4782
-            print('requesting unbalanced land2b')
4783
-            own['lland'] = own['requestAction']
4784
-        else:
4785
-            own['lland'] = own['requestAction']    
4786
-
4787
-    if own['requestAction'] == 'fak_land':
4788
-        print('*****************ra', land_overRideL, land_overRideR, land_overRideLb, land_overRideRb)
4789
-        if land_overRideL == True:
4790
-            own['requestAction'] = 'fak_landL'
4791
-            print('requesting unbalanced landf1')
4792
-            own['lland'] = own['requestAction']
4793
-        elif land_overRideR == True:
4794
-            own['requestAction'] = 'fak_landR'
4795
-            print('requesting unbalanced landf2')
4796
-            own['lland'] = own['requestAction']
4797
-        elif land_overRideLb == True:
4798
-            own['requestAction'] = 'fak_landLb'
4799
-            print('requesting unbalanced landf1b')
4800
-            own['lland'] = own['requestAction']
4801
-        elif land_overRideRb == True:
4802
-            own['requestAction'] = 'fak_landRb'
4803
-            print('requesting unbalanced landf2b')
4804
-            own['lland'] = own['requestAction']
4805
-        else:
4806
-            own['lland'] = own['requestAction']    
4807
-    # if own['requestAction'] in ['fak_land', 'reg_land', 'fak_landL', 'fak_landLb', 'reg_landR', 'reg_landRb', 'fak_landR' 'fak_landRb', 'reg_landL', 'reg_landLb']:
4808
-    #print(own['requestAction'], 'controller end request')
4809
-
4810
-
4811
-
4812
-    own['ground_since'] = ground_since
4813
-    if own['rotz'] < .97:
4814
-        if own['requestAction'] == 'reg_roll':
4815
-            own['requestAction'] = 'reg_opos'
4816
-        if own['requestAction'] == 'reg_turnLeft':
4817
-            own['requestAction'] = 'reg_pump_left'
4818
-        if own['requestAction'] == 'reg_turnRight':
4819
-            own['requestAction'] = 'reg_pump_right'
4820
-
4821
-        if own['requestAction'] == 'fak_roll':
4822
-            own['requestAction'] = 'fak_opos'
4823
-        if own['requestAction'] == 'fak_turnLeft':
4824
-            own['requestAction'] = 'fak_pump_left'
4825
-        if own['requestAction'] == 'fak_turnRight':
4826
-            own['requestAction'] = 'fak_pump_right'
4800
+ 
4801
+
4802
+

+ 19
- 54
scripts/ragdoll.py View File

15
         
15
         
16
         if 'rd_cl' in str(const):
16
         if 'rd_cl' in str(const):
17
             const.enforce = 0
17
             const.enforce = 0
18
-            #print(const)
18
+            print(const)
19
         if 'rd_cr' in str(const):
19
         if 'rd_cr' in str(const):
20
             const.enforce = 0   
20
             const.enforce = 0   
21
     for x in own['rd_rb'].groupMembers:
21
     for x in own['rd_rb'].groupMembers:
22
         x.suspendDynamics(True)
22
         x.suspendDynamics(True)
23
 
23
 
24
-def set_influence(own, scene, strength):
25
-    armature = scene.objects['Char4']
26
-    for const in armature.constraints:
27
-        #print(const, 'const')
28
-        if ('rd_cl' in str(const) or 'rd_cr' in str(const)):
29
-            #print(const, 'const', strength)
30
-            const.enforce = strength  
31
-
32
     
24
     
33
 def update_rb(physBody, scene):
25
 def update_rb(physBody, scene):
34
     #print('updating rigid body positions')
26
     #print('updating rigid body positions')
98
         own['rd_set_vel'] = False
90
         own['rd_set_vel'] = False
99
         own['rd_vel'] = None
91
         own['rd_vel'] = None
100
         own['rd_incer'] = 0
92
         own['rd_incer'] = 0
101
-        own['rd_life'] = 0
102
-        zero_constraints(own, scene) 
93
+        zero_constraints(own, scene)    
103
 
94
 
104
-    #print(own['rd_life'], 'ragdoll incer')
105
     #if (sens.positive) or (dict['aBut'] == 1 and dict['bBut'] == 1) or own['fall'] == True:
95
     #if (sens.positive) or (dict['aBut'] == 1 and dict['bBut'] == 1) or own['fall'] == True:
106
     if (sens.positive) or own['fall'] == True:
96
     if (sens.positive) or own['fall'] == True:
107
         #print('option1')
97
         #print('option1')
110
             #own['fall'] = 1
100
             #own['fall'] = 1
111
             own['fall'] = True
101
             own['fall'] = True
112
             print('do ragdoll')
102
             print('do ragdoll')
113
-            own['rd_life'] = 0
114
             incer = -1
103
             incer = -1
115
             update_rb(own['rd_rb'], scene)   
104
             update_rb(own['rd_rb'], scene)   
116
             while incer < 20:
105
             while incer < 20:
133
             cont.actuators['Camera'].height = 2.0
122
             cont.actuators['Camera'].height = 2.0
134
             #cont.actuators['Camera'].min = 14.0
123
             #cont.actuators['Camera'].min = 14.0
135
             #cont.actuators['Camera'].max = 18.0
124
             #cont.actuators['Camera'].max = 18.0
136
-            cont.actuators['Camera'].damping = 0.001
125
+            cont.actuators['Camera'].damping = .000001
137
             cont.activate(cont.actuators['Camera']) 
126
             cont.activate(cont.actuators['Camera']) 
138
                         
127
                         
139
             #own.suspendDynamics()
128
             #own.suspendDynamics()
142
 
131
 
143
         if own['ragdoll_active'] == True:
132
         if own['ragdoll_active'] == True:
144
             #pass
133
             #pass
145
-            own['rd_life'] += 1
146
-            #scene.objects[armature].stopAction(2)
147
-            #scene.objects[armature].stopAction(7)
148
-            #scene.objects[armature].update()
149
-            #cont.actuators['Camera'].object = scene.objects['ragdoll_parent']
150
-            own.worldPosition = scene.objects['ragdoll_parent'].worldPosition
151
-            #cont.actuators['Camera'].object = own
134
+            scene.objects[armature].stopAction(2)
135
+            scene.objects[armature].stopAction(7)
136
+            scene.objects[armature].update()
137
+            cont.actuators['Camera'].object = scene.objects['ragdoll_parent']
152
             wp = scene.objects['camCube'].worldPosition - scene.objects['ragdoll_parent'].worldPosition
138
             wp = scene.objects['camCube'].worldPosition - scene.objects['ragdoll_parent'].worldPosition
153
             wp = wp * .9
139
             wp = wp * .9
154
-            cont.actuators['Camera'].height = 1.7
140
+            cont.actuators['Camera'].height = 2.0
155
             cont.actuators['Camera'].min = 4.0
141
             cont.actuators['Camera'].min = 4.0
156
-            cont.actuators['Camera'].max = 7.0
157
-            #cont.actuators['Camera'].damping = .000001
158
-            cont.actuators['Camera'].damping = .006#.99
142
+            cont.actuators['Camera'].max = 8.0
143
+            cont.actuators['Camera'].damping = .000001
159
             cont.activate(cont.actuators['Camera']) 
144
             cont.activate(cont.actuators['Camera']) 
160
             #print(own['rd_set_vel'], 'vel setter')
145
             #print(own['rd_set_vel'], 'vel setter')
161
             if own['rd_set_vel'] == True:
146
             if own['rd_set_vel'] == True:
171
                     #scene.objects['npc_ed_arm_phys_master'].worldLinearVelocity.x = 100
156
                     #scene.objects['npc_ed_arm_phys_master'].worldLinearVelocity.x = 100
172
                     #scene.objects['npc_ed_arm_phys_master'].applyForce([5000,0,0], False)
157
                     #scene.objects['npc_ed_arm_phys_master'].applyForce([5000,0,0], False)
173
                     for pB in own['rd_rb'].groupMembers:
158
                     for pB in own['rd_rb'].groupMembers:
174
-                        #print('setting', pB, own['rd_vel'])
159
+                        print('setting', pB, own['rd_vel'])
175
                         
160
                         
176
                         try:
161
                         try:
177
                             #pass
162
                             #pass
179
                             #pB.worldLinearVelocity.x = 100
164
                             #pB.worldLinearVelocity.x = 100
180
                             #pB.worldLinearVelocity = own['rd_vel']
165
                             #pB.worldLinearVelocity = own['rd_vel']
181
                             pB.setLinearVelocity(own['rd_vel'], False)
166
                             pB.setLinearVelocity(own['rd_vel'], False)
182
-                            #print('adding force to', pB, pB.worldLinearVelocity)
167
+                            print('adding force to', pB, pB.worldLinearVelocity)
183
                         except:
168
                         except:
184
-                            #print('cant add force to ', pB)
185
-                            pass
169
+                            print('cant add force to ', pB)
186
                 else:
170
                 else:
187
                     own['rd_incer'] = 0
171
                     own['rd_incer'] = 0
188
                     own['rd_set_vel'] = False
172
                     own['rd_set_vel'] = False
189
             
173
             
190
-            if dict['last_yBut'] == 1 and dict['yBut'] == 0:                
174
+            if dict['yBut'] == 1:                
191
                 print('turn off ragdoll')
175
                 print('turn off ragdoll')
192
                 zero_constraints(own, scene)
176
                 zero_constraints(own, scene)
193
                 scene.objects[armature].setParent(own, False, True)
177
                 scene.objects[armature].setParent(own, False, True)
195
                 for x in own['rd_rb'].groupMembers:
179
                 for x in own['rd_rb'].groupMembers:
196
                     x.suspendDynamics(True)
180
                     x.suspendDynamics(True)
197
                 own['ragdoll_active'] = False    
181
                 own['ragdoll_active'] = False    
198
-                own['rd_life'] = 0
199
-                #print(scene.objects[armature].parent, 'parent')
182
+                print(scene.objects[armature].parent, 'parent')
200
                 cont.actuators['Camera'].object = scene.objects['camCube']
183
                 cont.actuators['Camera'].object = scene.objects['camCube']
201
                 cont.activate(cont.actuators['Camera']) 
184
                 cont.activate(cont.actuators['Camera']) 
202
                 own.worldPosition = scene.objects['npc_ed_arm_phys_master'].worldPosition
185
                 own.worldPosition = scene.objects['npc_ed_arm_phys_master'].worldPosition
203
                 own.worldPosition.z += .4
186
                 own.worldPosition.z += .4
204
-                own['requestAction'] = 'reg_onboard'
205
-                own['ragdoll_out'] = 1
206
                 cont.activate(cont.actuators['walk']) 
187
                 cont.activate(cont.actuators['walk']) 
207
-                
208
 
188
 
209
 
189
 
210
-            if dict['lUD'] < -.08 and own['rd_life'] > 360:
190
+            if dict['lUD'] < -.08:
211
                 physBody = own['rd_rb']
191
                 physBody = own['rd_rb']
212
                 excludes = ['npc_ed_arm_phys_hand.R', 'npc_ed_arm_phys_hand.L', 'npc_ed_arm_phys_forearm.fk.L', 'npc_ed_arm_phys_forearm.fk.R', 'npc_ed_arm_phys_upper_arm.fk.L', 'npc_ed_arm_phys_upper_arm.fk.R']
192
                 excludes = ['npc_ed_arm_phys_hand.R', 'npc_ed_arm_phys_hand.L', 'npc_ed_arm_phys_forearm.fk.L', 'npc_ed_arm_phys_forearm.fk.R', 'npc_ed_arm_phys_upper_arm.fk.L', 'npc_ed_arm_phys_upper_arm.fk.R']
213
                 #excludes = []
193
                 #excludes = []
214
                 for x in physBody.groupMembers:
194
                 for x in physBody.groupMembers:
215
-                    #print(x.name)
195
+                    print(x.name)
216
                                     
196
                                     
217
                     if x.name not in excludes:
197
                     if x.name not in excludes:
218
                         pass
198
                         pass
232
                 scene.objects['npc_ed_arm_phys_clavicle.L'].applyForce([0,0,200], False)
212
                 scene.objects['npc_ed_arm_phys_clavicle.L'].applyForce([0,0,200], False)
233
                 scene.objects['npc_ed_arm_phys_clavicle.R'].applyForce([0,0,200], False)
213
                 scene.objects['npc_ed_arm_phys_clavicle.R'].applyForce([0,0,200], False)
234
 
214
 
235
-            if dict['rUD'] > .08 and own['rd_life'] > 360:
215
+            if dict['rUD'] > .08:
236
                 scene.objects['npc_ed_arm_phys_master'].applyForce([0,600,0], True)
216
                 scene.objects['npc_ed_arm_phys_master'].applyForce([0,600,0], True)
237
-
238
-            blendamt = 20
239
-            if own['rd_life'] < blendamt:
240
-                dif = own['rd_life'] / blendamt
241
-            else:
242
-                dif = 1
243
-            set_influence(own, scene, dif)
244
-             
245
-            # scene.objects[armature].stopAction(1)
246
-            # scene.objects[armature].stopAction(2)
247
-            # scene.objects[armature].stopAction(3)
248
-            # scene.objects[armature].stopAction(4)
249
-            # scene.objects[armature].update()
250
- 
251
         else:
217
         else:
252
             update_rb(own['rd_rb'], scene)   
218
             update_rb(own['rd_rb'], scene)   
253
-            #pass
254
-        scene.objects[armature].update()    
219
+            #pass

+ 1
- 0
scripts/scene_init.py View File

160
         own['lland'] = ''
160
         own['lland'] = ''
161
         own['grinding'] = False
161
         own['grinding'] = False
162
         own['ground_since'] = 100
162
         own['ground_since'] = 100
163
+        own['last_transition_frame'] = 0
163
         
164
         
164
         colors.update_shirt_tex() 
165
         colors.update_shirt_tex() 
165
         colors.update_truck_tex()
166
         colors.update_truck_tex()

Loading…
Cancel
Save