Not sure if this is the *correct way* to accomplish this, but this is what I did to achieve the same thing in my game today.
First, I took the existing people\follow.fpi script and created a new script named darkai_follow:
:always:localvar=1
:state=0:aiusefullaim=1,setvar=0,state=1
:aiheardsound=200:aisettarget,airotatetotarget,state=2,shootplr
:aicanshoot=0:state=1
;//Common behavior triggers---------------------------------------------------------------------------------
:state=1,aicanshoot=0,waypointstate=0:waypointstart,animate=2
:state=1,aicanshoot=0,waypointstate=3:waypointnext,animate=2
:state=1,aicanshoot=0,waypointstate=4:waypointrandom,animate=2
:state=1,aicanshoot=0,waypointstate=5:waypointreverse,animate=2
;End of Script
Then I saved off a copy of main_weapon.fpi (renamed to modify_weapon_pjs.fpi) - my initials lol - and modified this line:
:state=1,aiteam=1,varequal=1,idle=1,plrdistwithin=100,aicanshoot=0:aimoverandom
to this:
:state=1,aiteam=1,varequal=1,idle=1,plrdistwithin=100,aicanshoot=0:runfpidefault=1
The darkai_follow script goes in your ally's main slot, and the modified main_weapon goes in the shoot slot. I used appear-ally-team1.fpi in the appear slot. Net result: The guys follow waypoints (without looking like they are on ice skates, lol) until they come across a bad guy, then they shoot it out with them until the fight is over and I walk up close enough to them (sort of like a regroup after the skirmish has ended) and then they resume cruising along the waypoints. Works great if you're making a tactical SWAT game like I am.
There's still some bugs (sometimes the guys do the moonwalk in reverse - feet going backward while they go forward - I think I know how to fix that tho), and I want to add some more stuff (like autorecruit ally and some custom sounds when they encounter an enemy, need help, etc) but I'm waiting to see what scripts come with MP53 before I do too much work on the scripting since those are the models I'll be using and Errant may have already figured most of that out for me
.
Hope that helps! Any ???'s let me know. I'm a bit of a noob when it comes to fpi scripting but I'm catching on...