I added a monster in my custom story, and it should patrol (not disappearing, or hallucination). I've placed the monster and its pathnodes.
Everything works fine, but then, the monster walks like an idiot. He runs towards his next pathnode, suddenly stops walking, turn around, runs in the other direction for a half second, turns around again, and follows his pathnodes. What can cause this? My script isn't that advanced, just adding pathnodes to it.
Now a second question: How can I make my monster patrol, so it doesn't disappear when it reached its last pathnode? It should go all pathnodes back to his starting point, and then starts over. This all the time.
(This post was last modified: 07-17-2011, 11:05 PM by MrCookieh.)
so it's normal that the monster behaves like an idiot?
(I once made a monster, with only one pathnode, at the other side of a wall. The monster walked the whole time against a wall, although there was a door some metres next to him... so I think I have to live with that AI...)
Anyways, that's not that bad, but how about the patroling thing?
Quote:Now a second question: How can I make my monster patrol, so it doesn't disappear when it reached its last pathnode? It should go all pathnodes back to his starting point, and then starts over. This all the time.
In your debug menu, enable the entity info option. This will display active monsters' state (path, investigate, hunt, alert, wait, etc) as well as its current node. It will basically give you a lot of information which can help you determine what is causing your monster to freak out. It could be that the edge nodes (path nodes between your script-assigned nodes) are poorly placed. It could be that your scripted path nodes are in the wrong order, too.
Anyways, just study the monster with the entity info and see if you can figure out exactly what causes it.
Now as for your quote, to prevent a monster from disappearing, just assign it new path nodes once it reaches or nears the end of its path, using a collide callback that doesn't auto-remove.
Put that in your OnStart, match the parent and child names to the props in your map, and make sure your function contains ClearEnemyPatrolNodes("grunt");