|
@@ -460,36 +460,7 @@ def main(cont):
|
460
|
460
|
if (minDist is None or dist < minDist):
|
461
|
461
|
nearestObject = obj
|
462
|
462
|
minDist = dist
|
463
|
|
- # if nearestObject != None:
|
464
|
|
- # #print(nearestObject)
|
465
|
|
- # obj = nearestObject
|
466
|
|
- # player_e = own.worldOrientation.to_euler()
|
467
|
|
- # player_pos = own.worldPosition
|
468
|
|
- # player_rotz = math.degrees(player_e[2])
|
469
|
|
- # grinder_e = obj.worldOrientation.to_euler()
|
470
|
|
- # grinder_rotz = math.degrees(grinder_e[2])
|
471
|
|
- # rot = player_rotz - grinder_rotz
|
472
|
|
- # grinder_pos = obj.worldPosition
|
473
|
|
- # worldVect = [1, 0, 0]
|
474
|
|
- # vect = obj.getAxisVect(worldVect)
|
475
|
|
- # go = obj.worldOrientation
|
476
|
|
- # grinder_axis = [1,0,0]
|
477
|
|
- # try:
|
478
|
|
- # delta = player_pos - grinder_pos
|
479
|
|
-
|
480
|
|
- # delta = delta.cross(vect)
|
481
|
|
- # if delta[2] >= 0:
|
482
|
|
- # grindside = "right"
|
483
|
|
- # else:
|
484
|
|
- # grindside = "left"
|
485
|
|
- # deltamove = delta[2] * .1#.25
|
486
|
|
- # if STANCE == 0:
|
487
|
|
- # move = [-deltamove, 0, 0]
|
488
|
|
- # else:
|
489
|
|
- # move = [deltamove, 0, 0]
|
490
|
|
- # own.applyMovement(move, True)
|
491
|
|
- # except:
|
492
|
|
- # pass
|
|
463
|
+
|
493
|
464
|
print('dropin')
|
494
|
465
|
if STANCE == 0:
|
495
|
466
|
own['requestAction'] ='reg_dropin'
|
|
@@ -867,243 +838,7 @@ def main(cont):
|
867
|
838
|
except:
|
868
|
839
|
pass
|
869
|
840
|
|
870
|
|
- # def switchcam():
|
871
|
|
- # if ltsBut == False and own['lastlts'] == True and rtsBut == False:
|
872
|
|
- # if own['camera'] == 1:
|
873
|
|
- # own['camera'] = 0
|
874
|
|
- # else:
|
875
|
|
- # own['camera'] = 1
|
876
|
|
- # if rtsBut == False and own['lastrts'] == True and ltsBut == False:
|
877
|
|
- # if own['camera'] == 2:
|
878
|
|
- # own['camera'] = 0
|
879
|
|
- # else:
|
880
|
|
- # own['camera'] = 2
|
881
|
|
- # #followcam
|
882
|
|
- # def move_followcam():
|
883
|
|
- # if own['camera'] == 2:
|
884
|
|
- # if own['lastbkBut'] == True and bkBut == False:
|
885
|
|
- # #print("activate move followcam")
|
886
|
|
- # if own['move_followcam'] == False:
|
887
|
|
- # own['move_followcam'] = True
|
888
|
|
- # else:
|
889
|
|
- # own['move_followcam'] = False
|
890
|
|
- # if own['move_followcam'] == True:
|
891
|
|
- # camspeed1 = .015
|
892
|
|
- # camspeed2 = .055
|
893
|
|
- # camrot1 = .005
|
894
|
|
- # camrot2 = .02
|
895
|
|
- # #up
|
896
|
|
- # if lUD < -0.080:
|
897
|
|
- # followcam.actuators["up"].dLoc = [ 0, 0, -camspeed2]
|
898
|
|
- # cont.activate(followcam.actuators["up"])
|
899
|
|
- # #print("fastup")
|
900
|
|
- # else:
|
901
|
|
- # cont.deactivate(followcam.actuators["up"])
|
902
|
|
- # # #down
|
903
|
|
- # if lUD > .080:
|
904
|
|
- # followcam.actuators["down"].dLoc = [ 0, 0, camspeed2]
|
905
|
|
- # cont.activate(followcam.actuators["down"])
|
906
|
|
- # else:
|
907
|
|
- # cont.deactivate(followcam.actuators["down"])
|
908
|
|
- # # #left
|
909
|
|
- # #if lLR < -0.080:
|
910
|
|
- # if lLR > 0.080:
|
911
|
|
- # followcam.actuators["left"].dLoc = [-camspeed2, 0, 0]
|
912
|
|
- # cont.activate(followcam.actuators["left"])
|
913
|
|
- # else:
|
914
|
|
- # cont.deactivate(followcam.actuators["left"])
|
915
|
|
- # # #right
|
916
|
|
- # #if lLR > 0.080:
|
917
|
|
- # if lLR < -0.080:
|
918
|
|
- # followcam.actuators["right"].dLoc = [camspeed2, 0, 0]
|
919
|
|
- # cont.activate(followcam.actuators["right"])
|
920
|
|
- # else:
|
921
|
|
- # cont.deactivate(followcam.actuators["right"])
|
922
|
|
- # #up
|
923
|
|
- # if rUD < -0.080:
|
924
|
|
- # followcam.actuators["rotup"].dLoc = [0, 0, camrot2]
|
925
|
|
- # cont.activate(followcam.actuators["rotup"])
|
926
|
|
- # else:
|
927
|
|
- # cont.deactivate(followcam.actuators["rotup"])
|
928
|
|
- # # #down
|
929
|
|
- # if rUD > .080:
|
930
|
|
- # followcam.actuators["rotdown"].dLoc = [0, 0, -camrot2]
|
931
|
|
- # cont.activate(followcam.actuators["rotdown"])
|
932
|
|
- # else:
|
933
|
|
- # cont.deactivate(followcam.actuators["rotdown"])
|
934
|
|
- # # #left
|
935
|
|
- # if rLR < -0.080:
|
936
|
|
- # followcam.actuators["rotleft"].dRot = [0, 0, camrot2]
|
937
|
|
- # cont.activate(followcam.actuators["rotleft"])
|
938
|
|
- # else:
|
939
|
|
- # cont.deactivate(followcam.actuators["rotleft"])
|
940
|
|
- # # #right
|
941
|
|
- # if rLR > 0.080:
|
942
|
|
- # followcam.actuators["rotright"].dRot = [0, 0, -camrot2]
|
943
|
|
- # cont.activate(followcam.actuators["rotright"])
|
944
|
|
- # else:
|
945
|
|
- # cont.deactivate(followcam.actuators["rotright"])
|
946
|
|
-
|
947
|
|
- # #*********************************************
|
948
|
|
-
|
949
|
|
- # if lUD > -0.080 and lUD < -0.030:
|
950
|
|
- # followcam.actuators["up"].dLoc = [ 0, 0, -camspeed1]
|
951
|
|
- # cont.activate(followcam.actuators["up"])
|
952
|
|
- # else:
|
953
|
|
- # cont.deactivate(followcam.actuators["up"])
|
954
|
|
- # # #down
|
955
|
|
- # if lUD < .080 and lUD > .03:
|
956
|
|
- # followcam.actuators["down"].dLoc = [ 0, 0, camspeed1]
|
957
|
|
- # cont.activate(followcam.actuators["down"])
|
958
|
|
- # else:
|
959
|
|
- # cont.deactivate(followcam.actuators["down"])
|
960
|
|
- # # #left
|
961
|
|
- # if lLR > -0.080 and lLR < -0.030:
|
962
|
|
- # followcam.actuators["left"].dLoc = [-camspeed1, 0, 0]
|
963
|
|
- # cont.activate(followcam.actuators["left"])
|
964
|
|
- # else:
|
965
|
|
- # cont.deactivate(followcam.actuators["left"])
|
966
|
|
- # # #right
|
967
|
|
- # if lLR < .080 and lLR > .03:
|
968
|
|
- # followcam.actuators["right"].dLoc = [camspeed1, 0, 0]
|
969
|
|
- # cont.activate(followcam.actuators["right"])
|
970
|
|
- # else:
|
971
|
|
- # cont.deactivate(followcam.actuators["right"])
|
972
|
|
- # #up
|
973
|
|
- # if rUD > -0.080 and rUD < -0.030:
|
974
|
|
- # followcam.actuators["rotup"].dRot = [camrot1, 0, 0]
|
975
|
|
- # cont.activate(followcam.actuators["rotup"])
|
976
|
|
- # else:
|
977
|
|
- # cont.deactivate(followcam.actuators["rotup"])
|
978
|
|
- # # #down
|
979
|
|
- # if rUD < .080 and rUD > .03:
|
980
|
|
- # followcam.actuators["rotdown"].dRot = [-camrot1, 0, 0]
|
981
|
|
- # cont.activate(followcam.actuators["rotdown"])
|
982
|
|
- # else:
|
983
|
|
- # cont.deactivate(followcam.actuators["rotdown"])
|
984
|
|
- # # #left
|
985
|
|
- # if rLR > -0.080 and rLR < -0.030:
|
986
|
|
- # followcam.actuators["rotleft"].dRot = [0, 0, camrot1]
|
987
|
|
- # cont.activate(followcam.actuators["rotleft"])
|
988
|
|
- # else:
|
989
|
|
- # cont.deactivate(followcam.actuators["rotleft"])
|
990
|
|
- # # #right
|
991
|
|
- # if rLR < .080 and rLR > .03:
|
992
|
|
- # followcam.actuators["rotright"].dRot = [0, 0, -camrot1]
|
993
|
|
- # cont.activate(followcam.actuators["rotright"])
|
994
|
|
- # else:
|
995
|
|
- # cont.deactivate(followcam.actuators["rotright"])
|
996
|
|
- # def move_flycam():
|
997
|
|
- # if own['camera'] == 1:
|
998
|
|
- # if own['lastbkBut'] == True and bkBut == False:
|
999
|
|
- # if own['move_freecam'] == False:
|
1000
|
|
- # own['move_freecam'] = True
|
1001
|
|
- # else:
|
1002
|
|
- # own['move_freecam'] = False
|
1003
|
|
- # if own['move_freecam'] == True:
|
1004
|
|
- # camspeed1 = .015
|
1005
|
|
- # camspeed2 = .055
|
1006
|
|
- # camrot1 = .005
|
1007
|
|
- # camrot2 = .02
|
1008
|
|
- # #up
|
1009
|
|
- # if lUD < -0.080:
|
1010
|
|
- # freecam.actuators["up"].dLoc = [ 0, 0, -camspeed2]
|
1011
|
|
- # cont.activate(freecam.actuators["up"])
|
1012
|
|
- # else:
|
1013
|
|
- # cont.deactivate(freecam.actuators["up"])
|
1014
|
|
- # # #down
|
1015
|
|
- # if lUD > .080:
|
1016
|
|
- # freecam.actuators["down"].dLoc = [ 0, 0, camspeed2]
|
1017
|
|
- # cont.activate(freecam.actuators["down"])
|
1018
|
|
- # else:
|
1019
|
|
- # cont.deactivate(freecam.actuators["down"])
|
1020
|
|
- # # #left
|
1021
|
|
- # if lLR < -0.080:
|
1022
|
|
- # freecam.actuators["left"].dLoc = [-camspeed2, 0, 0]
|
1023
|
|
- # cont.activate(freecam.actuators["left"])
|
1024
|
|
- # else:
|
1025
|
|
- # cont.deactivate(freecam.actuators["left"])
|
1026
|
|
- # # #right
|
1027
|
|
- # if lLR > 0.080:
|
1028
|
|
- # freecam.actuators["right"].dLoc = [camspeed2, 0, 0]
|
1029
|
|
- # cont.activate(freecam.actuators["right"])
|
1030
|
|
- # else:
|
1031
|
|
- # cont.deactivate(freecam.actuators["right"])
|
1032
|
|
- # #up
|
1033
|
|
- # if rUD < -0.080:
|
1034
|
|
- # freecam.actuators["rotup"].dRot = [camrot2, 0, 0]
|
1035
|
|
- # cont.activate(freecam.actuators["rotup"])
|
1036
|
|
- # else:
|
1037
|
|
- # cont.deactivate(freecam.actuators["rotup"])
|
1038
|
|
- # # #down
|
1039
|
|
- # if rUD > .080:
|
1040
|
|
- # freecam.actuators["rotdown"].dRot = [-camrot2, 0, 0]
|
1041
|
|
- # cont.activate(freecam.actuators["rotdown"])
|
1042
|
|
- # else:
|
1043
|
|
- # cont.deactivate(freecam.actuators["rotdown"])
|
1044
|
|
- # # #left
|
1045
|
|
- # if rLR < -0.080:
|
1046
|
|
- # freecam.actuators["rotleft"].dRot = [0, 0, camrot2]
|
1047
|
|
- # cont.activate(freecam.actuators["rotleft"])
|
1048
|
|
- # else:
|
1049
|
|
- # cont.deactivate(freecam.actuators["rotleft"])
|
1050
|
|
- # # #right
|
1051
|
|
- # if rLR > 0.080:
|
1052
|
|
- # freecam.actuators["rotright"].dRot = [0, 0, -camrot2]
|
1053
|
|
- # cont.activate(freecam.actuators["rotright"])
|
1054
|
|
- # else:
|
1055
|
|
- # cont.deactivate(freecam.actuators["rotright"])
|
1056
|
|
-
|
1057
|
|
- # #*********************************************
|
1058
|
841
|
|
1059
|
|
- # if lUD > -0.080 and lUD < -0.030:
|
1060
|
|
- # freecam.actuators["up"].dLoc = [ 0, 0, -camspeed1]
|
1061
|
|
- # cont.activate(freecam.actuators["up"])
|
1062
|
|
- # #print(lUD)
|
1063
|
|
- # else:
|
1064
|
|
- # cont.deactivate(freecam.actuators["up"])
|
1065
|
|
- # # #down
|
1066
|
|
- # if lUD < .080 and lUD > .03:
|
1067
|
|
- # freecam.actuators["down"].dLoc = [ 0, 0, camspeed1]
|
1068
|
|
- # cont.activate(freecam.actuators["down"])
|
1069
|
|
- # else:
|
1070
|
|
- # cont.deactivate(freecam.actuators["down"])
|
1071
|
|
- # # #left
|
1072
|
|
- # if lLR > -0.080 and lLR < -0.030:
|
1073
|
|
- # freecam.actuators["left"].dLoc = [-camspeed1, 0, 0]
|
1074
|
|
- # cont.activate(freecam.actuators["left"])
|
1075
|
|
- # else:
|
1076
|
|
- # cont.deactivate(freecam.actuators["left"])
|
1077
|
|
- # # #right
|
1078
|
|
- # if lLR < .080 and lLR > .03:
|
1079
|
|
- # freecam.actuators["right"].dLoc = [camspeed1, 0, 0]
|
1080
|
|
- # cont.activate(freecam.actuators["right"])
|
1081
|
|
- # else:
|
1082
|
|
- # cont.deactivate(freecam.actuators["right"])
|
1083
|
|
- # #up
|
1084
|
|
- # if rUD > -0.080 and rUD < -0.030:
|
1085
|
|
- # freecam.actuators["rotup"].dRot = [camrot1, 0, 0]
|
1086
|
|
- # cont.activate(freecam.actuators["rotup"])
|
1087
|
|
- # else:
|
1088
|
|
- # cont.deactivate(freecam.actuators["rotup"])
|
1089
|
|
- # # #down
|
1090
|
|
- # if rUD < .080 and rUD > .03:
|
1091
|
|
- # freecam.actuators["rotdown"].dRot = [-camrot1, 0, 0]
|
1092
|
|
- # cont.activate(freecam.actuators["rotdown"])
|
1093
|
|
- # else:
|
1094
|
|
- # cont.deactivate(freecam.actuators["rotdown"])
|
1095
|
|
- # # #left
|
1096
|
|
- # if rLR > -0.080 and rLR < -0.030:
|
1097
|
|
- # freecam.actuators["rotleft"].dRot = [0, 0, camrot1]
|
1098
|
|
- # cont.activate(freecam.actuators["rotleft"])
|
1099
|
|
- # else:
|
1100
|
|
- # cont.deactivate(freecam.actuators["rotleft"])
|
1101
|
|
- # # #right
|
1102
|
|
- # if rLR < .080 and rLR > .03:
|
1103
|
|
- # freecam.actuators["rotright"].dRot = [0, 0, -camrot1]
|
1104
|
|
- # cont.activate(freecam.actuators["rotright"])
|
1105
|
|
- # else:
|
1106
|
|
- # cont.deactivate(freecam.actuators["rotright"])
|
1107
|
842
|
if r_ground.triggered == False:
|
1108
|
843
|
cont.deactivate(own.actuators["walk_align"])
|
1109
|
844
|
else:
|