ID:161119
![]() Jun 15 2008, 9:50 am
|
|
im trying to make a fighting game with stick figures thats single player, but i dont know how to make NPCs that attack the player back, does anyone know how to do this?
|
nvm, problem is, its view() not oview(), so it can attack itself...
remembered i had that same problem with my attack verb at first.... |
Ok The Previous code done by kaiochao was correct for the most part but unfortunately he forgot to put it so it only attacks clients not other monsters so i will show it the correct way (basically the same just one more bar of code)<code>
mob/AI |
It was simply a basic example, he knew it wasn't perfect. There was no need to bump this up, your addition was also very simple and easy to do anyway, and wasn't worth it either.
|
I was doing more of a just in case sort of thing just in case he didn't add that very simple addition. and if he hadn't there would be monsters attacking each other instead of the player i was just making sure that he didn't add it and wonder why it was attacking the other monsters.
|
I'll give you an example of a basic AI system.
At the moment, all they do is walk around aimlessly and attack anyone who comes near. It doesn't chase anything, retreat, or anything. That's for you to make yourself.