Hello everyone, hope yall doing well. Im in a pickle right now and wondering if anyone could help. I made a Finite state Machine based AI that follows you around and shoots you, by using a cone object that uses a “property” and ray targeting system that sends messages to the actual AI. It works pretty well when there is only one of them and if its on the same layer as what its searching for. When I try to make a spawner for a “horde” mode or an instant action type team death match only 2 of them work. My guess is since they are all the same object the messages conflict with eachother, saying player (or friendly AI) found then instantly saying lost because one of the other AI objects doesn’t see it. I hope that makes sense, if it doesnt I will elaborate. I remeber someone saying making an instance in python for the spawner. How would I go about doing that? Thank you for everyone sticking around reading this, any help would be amazing.
My WinZip is constantly telling me it’s expired soon after I install it, so I can’t open those files and I’m not going to bother reinstalling it any more.
It could be because I am using UPBGE instead of blender game engine. Basically how the ai works is by states. 1st state it idles until the “eyes” cone sees the player, then it sends a message to the ai cube telling it to switch to the 2nd state which it will track the player. There is a timer that will be set to zero as long as the “eyes” see the player. Once the player hides behind a wall or something for 3 seconds the ai cube will switch to state 3, the pathfinding state. It will go to the player using pathfinding until the “eyes” lock onto the player once again switching it back to 2nd state. I have a death state (5) but havent set up the guns yet. But that is how it works, the player should have full functionality wasd, shift, and space to jump
Here is a video I made showing gameplay VIDEO IS LOUD WHEN SHOOTING
check the console for errors, you blend spews a lot
here is the ones that comes the most
Error: Nand(AI Cube), Python script error
Traceback (most recent call last):
File "Pathfinding", line 11, in <module>
ValueError: actuator.object = value: SCA_SteeringActuator, requested name "" did not match any KX_GameObject in this scene
Error: And.001(eyes), Python script error
Traceback (most recent call last):
File "TrackToNearest.py", line 30, in <module>
NameError: name 'obj' is not defined
This is the problem I am having. So for the second blend I made 2 different teams of ai to battle against eachother. There is only really 2 ai objects (one of each, on a separate layer) but they have multiple spawn points, spawning about 4 each im pretty sure. So what I think the problem truly is, when one of the ai’s “eyes” ray sensor sees a player it sends a message back to the ai object saying to track and shoot it. But since the other ai are in a different area and don’t see a player it sends a message to the ai object to not track the player because it doesn’t see it. The ai also has a near sensor that when activated is supposed to send the ai object to state 3 to pathfind the player. But since the player isn’t in some of the other ai’s near sensor bounds it tells them not to find the player. I hope that all makes sense
It works if all of them are separate objects, but not if its they are the same but uses a spawner. Im wondering if anyone knows how to make a spawner like an empty that will add the same object “ai cube” but make them all be separate while being added
Sorry I’ve been away, thank you for that that actually helps alot! What about the “skeleton” armature used for tracking to the player aswell, since its not the parent how would I do that one?
Since its in an if statement it does that, so they recommended taking it out of the if statement before hand but I looked and it already is to my knowledge, what am I doing wrong?