I would like an NPC to constantly move in a predetermined path back and forth on patrol, however the NPC does not do this. He will stop periodically and stand, how can a avoid this? Is there an AI package setting I can use?
You may not require a pathgrid, but it will make travel more reliable. Find the coordinates of each end of the patrol and use AITravel to move the NPC from one end to the other and back again. I think a brief pause at each end is appropriate, but of course it is your call.
Begin PatrolScript; Attached to patrolling NPCshort stateSetHello 0 ; prevent idle greetings as player approachesif ( state == 0 ) SetHello 0 ; prevents idle greetings as player approaches set state to 10 AITravel x1 y1 z1 ; coordinates of one endelseif ( state == 10 ) if ( GetAIPackageDone == 1 ) ; arrived at end of patrol set state to 20 endifelseif ( state == 20 ) set state to 30 AITravel x2 y2 z2 ; coordinates of other endelseif ( state == 30 ) if ( GetAIPackageDone == 1 ) ; arrived at other end of patrol set state to 0 endifendifEnd
There is nothing in this code to reset the script if the NPC's travel is disrupted by the player resting for fast traveling in the cell with the NPC. It is possible such actions by the player could suspend travel. If the patrol distance is too great or interrupted by obstacles, a pathgrid will help or you may require multiple waypoints.