ID:155004
 
Is it possible to make a simple code that if player is not in NPC oview(7) npc is forced to go back to his spawn.And prevent AI from walking diagonally while walking back.
Yes.
In response to Robertbanks2
How obout some help with coding.Ty
In response to LaNuiit
Use Del() and New(), it's really easy. You have to delete him when he goes out of view and use new() to respawn him.

We are not here to write codes for you. We are here to help you make them.
In response to Avainer1
Avainer1 wrote:
Use Del() and New(), it's really easy. You have to delete him when he goes out of view and use new() to respawn him.

We are not here to write codes for you. We are here to help you make them.
Well i know there is a simple way like:

step_to(idk what was in here)
In response to Avainer1
That would completely redundant as you could set a variable for their <code>x</code>, <code>y</code> and <code>z</code> in <code>mob/AI(?)/New()</code> and have a reset <code>proc</code> that sets them back to their location when the player is out of view.
In response to LaNuiit
Press F1 while openning the DreamMaker compiler, go to the search tab and find what you need/
In response to Neimo
If the mobs are already placed on the map at compile time, you can use loc=initial(loc) to make them return to their original position instead of storing their location and returning them through that.