So I am working on having an entity (Colonel X) follow a waypoint that takes him to a door, with a main script that is looking for that entity, and when he is close, it should open, then close after Colonel X has walked away, continuing to follow his waypoint. I have the .fpi files in the zip folder here, or you could look at them here.
Here is the Main for Colonel X
;Artificial Intelligence Script
;Header
desc = Pace Waypoints, If See Player, Rotate And Talk
;Triggers
:always:localvar=1
:state=0:aiusefullaim=1,setvar=0
:waypointstate=0:animate=2,waypointstart
:waypointstate=3:animate=2,waypointnext
:waypointstate=4:animate=2,waypointrandom
:waypointstate=5:animate=2,waypointreverse
:nearactivatable=0:settarget,activatetarget=2,animate=1,state=0
:state=0:state=1
:state=1,plrdistwithin=50:settarget,state=2
:state=1,random=20:rotateheadrandom=65
:state=2:waypointstop,rotatetoplr,state=3
:state=3:animate=1,state=1,talk=$1
;End of Script
Here is the Main for the door.
;Artificial Intelligence Script
;Header
desc = Player Proximity Door (Open and Close)
;Triggers
::settargetname=Colonel X
:state=0,aitargetdistwithin=50:state=4
:state=1:incframe=0
:state=1,frameatend=0:state=2,coloff
:state=2,aitargetdistfurther=200:state=3,sound=$1,colon
:state=3:decframe=0
:state=3,frameatstart=0:state=0,setframe=0
:state=4,aitargetdistwithin=50:state=1,setframe=0,sound=$0
:state=4:state=0
;End of Script