I really need help with the enemy ai. I need to configure 1 stable build very soon and I don’t have the enemy ai, and I can’t figure out. I need something basic for now. I know that this isn’t a commercial forum or something like this, but I can pay for the AI script.
If you wanna hire someone this isn’t the place, look for freelancers on wanted sites.
if you want help doing it yourself you’re gonna need to tell us what the game is and what the ai needs to do.
if you don’t know what you want the ai to do go and consult at the game design forum.
the scripting forum is if you know what you want the code to do but can’t get it to do it.
I know what the enemy should do, but I can’t get it to work
This is the schematic(My artistic skills are very “high” ):
So what you wanna do is give the AI a state machine with two states, “Patrolling” and “Chasing”
when patrolling just make him walk the waypoint, check if he can see the player, if so - change state to chase.
when chasing make him get in range attack with the player, when in attack range - attack, if lost sight (over distance limit/obstructed) revert back to patrolling state.
depending on how you implement it you might wanna have a third state for going back to the patrol route, incase that code can’t handle an “out-of-bound” position.
might wanna have a “chasing” and “attacking” states, maybe when losting track of the player you can send the AI into a “searching” state where he looks around for a bit before giving up and going back to the patrol.
what is not working? what did you try? help us help you
It’s called “programmer art” and you’re in the scripting forum, so it’s probably up to par with most of us, haha
(I personally do sketches like this on a physical piece of paper, computer for the docs notebook for the drawings)