AI waypoint paths, Return to last node in path

Blitz3D Forums/Blitz3D Programming/AI waypoint paths, Return to last node in path

Aussie(Posted 2014) [#1]
Hey there all, been a while since i posted here.

Got back into some coding again & have been playing around with some AI & waypoints. I have it working pretty much the way i want for now, but i seem to have had a brain fart & have lost the ability to figure out how to get this final piece of the waypoint following code working & could do with a different set of eyes to have a quick look at it.

I have created 2 separate paths for an enemy to follow. What i am trying to do is when the enemy changes paths, then back to the original path again is to have the enemy return to the active waypoint on that path then continue through the rest of the waypoints.

I have set up values to store the waypoint node that the enemy was on when the paths change but just can't figure out how to get it all working at the moment.

If someone could take a look that would be awesome.

It's under the Update_Objects function.




Aussie(Posted 2014) [#2]
Had another look at it this morning with a fresh set of eyes & got it sorted. Here is the code if anyone wants to have a look at what i did or if anyone wants to offer some suggestions on better ways to do what i am doing.

Next up some more Ai states.