I recently coded an NPC available here
The idea of the project is that when real players are not filling up slots on a empty GMOD Murder server, these will, and they will fight the few players online.
Now right now the code is very basic. Less than 100 lines. So that being said, the pathfinding is decent, but not great. They can chase you down an kill you, but if there is a door between you, they are out of luck.
So, basically I re purposed a Source engine bot to play Murder, so it is basically an Aimbot player. A huge bug thought is, when everyone is dead and there are only 2 bots left, they end up having a staring contest indefinitely through the wall.
I looked into nextbot navigation, but nextbots aren’t detailed enough for me, so I use real bots. I like the pathfinding now, because it is unpredictable, but I need help.
I need a timer to run (Believe me, I did some timer stuff, but GMOD hates me), that will check if the position of the bot hasn’t changed in about 2 seconds, it will switch to the nextbot navmesh system, and more intelligently pathfind there, and then switch back.
Sorry for the messy thread. I am really bad at forum posts, but here is what I need.
Pathfinding algorithm to follow (.nav) files.
Timer to switch to better pathfinding when a certain movement threshhold isn’t reached.
Please help! Teach me of wise lua coders.
I crapped this together in 5 hrs, so it is not the best. Plus I had to relearn lua.
P.S. Feel free to decompile my addon and look at the code. I am open to teaching and instruction, not just copy-pasta.