I was wrighting a script for an enemies AI and a horrable thing happened. The game ran as expexted for about 2 seconds and then all of the textures went out, just as if the lights disapeared! the weirdest thing. The .blend is to big to post but here is the script it Hapened after i added lines 39 -41
import math
objectlist = GameLogic.getCurrentScene().getObjectList()
controller = GameLogic.getCurrentController()
EP = controller.getOwner()
p1 = objectlist["OBp1"]
pg = objectlist["OBenemy goal"]
eh = objectlist["OBEnemy Home"]
Ray = controller.getSensor("Ray")
Rayp1 = controller.getSensor("Ray p1")
N10T = controller.getSensor("Near 10 True")
N20F = controller.getSensor("Near 20 False")
N3T = controller.getSensor("Near 3 True")
#if N10T.isPositive():
#setattr(EP,"Motive", True)
if not N3T.isPositive():
if not Rayp1.isPositive():
if Ray.isPositive() and getattr(EP,"Motive"):
setattr(EP,"Point",True)
setattr(EP,"Motive",False)
#here is where the problem happened.
if not Ray.isPositive() not N20F.isPositive:
setattr(EP,"Point",False)
setattr(EP,"Move",True)
if Rayp1.isPositive():
print "p1 spoted"
if N3T.isPositive():
setattr(EP,"Motive", False)
setattr(EP,"Move", False)
if N20F.isPositive:
p1pos = p1.getPosition()
pg.setPosition(p1pos)
if not N20F.isPositive:
pepos = eh.getPosition()
pg.setPosition(pepos)
Ya I realized that in the counsal, but it did not help it happened when i parented an object to my player, I don’t know why. So i just parented to the armature instead and its working now but it was realy wierd.
What Blender version are you using?
This looks like pre-2.49 API.
Do not use getPosition()/setPosition() it is deprecated and inconsistent. Better use worldPosition/localPosition.
Since 2.49 properties access is in dictionary style: gameObject[“propname”]
BTW: Your variable names are really confusing.
I just forgot: Your data might be to much for your GPU. Test it on another PC.