So, I’m fairly new to Panda3D; only been using it for a few weeks now, so this might be a really stupid question, but I haven’t been able to figure it out, so any help at all would be greatly appreciated.
Anyways, I’m trying to use the pandAi library to do some simple flocking and pursuing behavior for a group of models. I’ve been able to get the pursuing working perfectly, so I know that I can’t be going about this the completely wrong way, but I can’t get flocking to work. When I add the flock initially, it starts out paused, and when I unpause it, it will only stay active for one frame, after which it says that it’s done and won’t flock anymore.
I imagine I’m doing something really stupid, but I can’t figure it out, and I haven’t been able to find any examples online using the pandAi flocking.
I just want continual flocking. I assume that’s possible. Any help would be greatly appreciated!
Here’s my AI code:
def setupAI(self): self.aiWorld = AIWorld(render) self.flockObject = Flock(1, 45, 5, 2, 4, 5) for i in range (1, 20): self.swarmer = Swarmer() self.aiChar = AICharacter("char", self.swarmer.avatar, 1, .01, .15) self.aiWorld.addAiChar(self.aiChar) self.flockObject.addAiChar(self.aiChar) self.aiBehaviors = self.aiChar.getAiBehaviors() self.aiBehaviors.flock(1) self.aiBehaviors.pursue(self.playerOne.avatar, 2) self.bees.append(self.aiChar) self.aiWorld.addFlock(self.flockObject) taskMgr.add(self.updateAI, "updateAI") def updateAI(self, task): self.aiBehaviors.resumeAi("flock") print self.aiBehaviors.behaviorStatus("flock") self.aiWorld.update() return task.cont