User Tools

Site Tools


Making an AI Pause on Patrol

:T1: :T2:


Is is assumed that you can already create ordinary patrol routes, and you can use links and set link Data.


If you add an AIWatchObj link from an AI to some object, the AI can be made to perform a wide variety of responses when certain conditions are met. The conditions include things like proximity to the object and the current alert level of the AI.

One of the responses the link can command is for the AI to wait for a specified amount of time. There are quite a few parameters to be set and repeatedly setting these for each pause would be quite tedious. A TrolPausePt can be used to have these set automatically.

Adding a Pause

  • Create a TrolPausePt somewhere along the AI’s patrol route. The best way to ensure the AI actually gets close enough to the object to trigger the link is to make it a part of the patrol route. Add an AIPatrol link from a TrolPt to the TrolPausePt, and another AIPatrol link from the TrolPausePt to the next TrolPt on the route.

NOTEME It should be noted that the TrolPausePt doesn’t have to be linked to the patrol route for it to be effective. This means you can have it teleported in or out if you want some event to add or remove the pause.

  • Add an AIWatchObj link from the AI to the TrolPausePt

NOTEME Marvel as the link Data is configured automatically. This is made possible by the AI→Utility→Watch: Watch link defaults property.

Customising the Responses

The responses can be changed for a specific link by editing the Data (don’t confuse this with AI→Utility→Watch: Watch link defaults property). The default response is for the AI to wait for around 5 seconds (the time is written in milliseconds). It’s rather difficult to set the time exactly because it also plays some ‘idle’ motions to make it look more natural. After the wait, the AI will wait for the current motion to finish before resuming its patrol.

Nevertheless, the time can still be increased to have the AI wait for longer, and you can make use of the other actions to allow for more complex behaviour. If you increase the Wait time, or do anything else which interrupts the patrol route, you should also make sure the Resuse delay is long enough for the AI to resume its patrol and get out of the Radius before it checks the conditions again.

You are not limited to the Wait action - you can use Go to object, Frob Object etc. Face is another useful action - you can have the AI turn to face behind himself, which would catch out players expecting an easy blackjack opportunity. After turning, the AI can then wait, turn to face the other way again, then carry on patrolling. Or the AI could wait for a few more seconds before carrying on.

dromed/pause_patrol.txt · Last modified: 2009/05/24 15:49 by r_soul