Yes it does, thank you very much. The sample works. Say, the character that is steered by Panda AI … can that be a nodepath (loader.loadModel) too? Because it is in my game, its not an Actor with animations 'n stuff.
EDIT: Ok, I just quickly tested that. Actor vs. model makes no difference.
I noticed that all samples add the task AIUpdate only when the first character enter the sim. I let the task run from the beginning, and when a pursuer spawns he’s added to pandaai. Is that relevant?
I noticed that the mass attribute is not explained or I overlooked it.
What about collisions? The shot I create has a collision sphere. All the shots in the game immediately after creation register a collision with the ship they spawned from. Those are then checked if they come from the ship that fired it and in that case nothing happens. Works for all shots in the game, but maybe not here?
EDIT2: Wait a seond, I think I got it.
This one crashes:
def addToAiEnv(self, model, sourceid):
aiChar = AICharacter("test", model, 100.0, 0.25, 10.0)
self.AIWorld.addAiChar(aiChar)
aiBehaviors = aiChar.getAiBehaviors()
sourcesTargetID = self.ShipObjects[sourceid].selectedTargetID
aiBehaviors.pursue(self.ShipObjects[sourcesTargetID].ShipModel, 1.0)
But if I add a self. before aiChar, it works:
def addToAiEnv(self, model, sourceid):
self.aiChar = AICharacter("test", model, 100.0, 0.25, 10.0)
self.AIWorld.addAiChar(self.aiChar)
aiBehaviors = self.aiChar.getAiBehaviors()
sourcesTargetID = self.ShipObjects[sourceid].selectedTargetID
aiBehaviors.pursue(self.ShipObjects[sourcesTargetID].ShipModel, 1.0)
Somebody please explain that one to me?!
EDIT3:
When a nodepath is added to the PandaAI sim, the node gets a random heading,
could that be?
When I use aiBehaviors.removeAi(“myname”) Terminal says: invalid option! This should work … I am using the same name that printList gives me.
How can I adjust how far a pursuer closes in on the target?
How do I adjust movement and turn speed? Yeah I know with those values mentioned above, but how exactly?
EDIT4:
Great, now the PandaAI lib crashes when I add a second character to the sim, i.e. fire a second guided missile. Those objects have unique names, so that can’t be it.