I'm making some baby steps. At this point I have an ai_patrol scriptobject skeleton. The AI_DEAD error threw me off for a little until I found this: http://forums.thedar...-thread/page-14 so thank you Obsttorte and Springheel.
I think I have a decent plan for how to handle this system. A goal is to make it as easy to integrate as Obsttorte's Hitman script. Attaching the timers to the patrolling guards would make that dropping it in easier, right? Otherwise people would have to manually set up a bunch of triggers off of the captain to every guard.
Here's my pseudocode for the ai_patrol at the moment in case anybody has feedback.
object ai_patrol : ai_darkmod_base
float patrol_time [is the format for this the number of seconds?]
entity patrol_base [any static entity, simply used to measure a distanceTo]
timer = createTimer(timer_stimID,0,0,0,0)
patrol_time = getFloatKey("patrol_time") [spawnArg]
patrol_start_point = getFloatKey("target0") [pretty sure there's something like getTarget() that'd be appropriate]
patrol_base = getEntity("patrol_base") [by entity name]
patrol_captain = getEntity("patrol_captain") [by entity name]
if distanceTo(patrol_base)>X && timer>max_time [I don't know how to compare these values]
At first I thought I was going to have to define a bunch of stuff for a patrol_captain and the patrol_base. It seems like all the captain really does is link the patrolMissing to some kind of "dispatchBackup" function which just sets the target of the patrol_backup to the path_corner. (I like how with this system if the player incapacitates the captain the whole thing goes into disarray.)
The two main things I'm trying to figure out now are what exactly CreateTimer does and where I need to use stim/responses.
Timers are a bit confusing because the CreateTimer returns void. Maybe I haven't read the documentation right though. Also, I'm not sure if I even need to use timers. The ai_patrol updateLoop() doesn't need to get run more than once a minute. The patrol_time spawnarg could be given in minutes then, and the loop just increments that number.
With the stim/response, the only one I think I need to have is a stim on the patrol_base with the response on the ai_patrol to set the timer to 0. With the radius parameter it looks like stims/responses are only meant to trigger actions within a specified location.