Hopefully someone can fill in the last missing piece I need.
I downloaded Heltor's free shooting range target from the TGC store for a shooting range level I'm making. What I wanted it to do was this:
1. Appear and turn towards the player (it has a built in animation for this)
2. Progress along a waypoint path until destroyed.
3. Respawn back at the beginning point.
So far so good, got that to work except for one small thing. What I can't seem to figure out is how to make it to stay at frame 50 or so as it traverses the waypoints - that way it will remain facing the player as it goes. Instead what happens is the animation loops, so it turns towards the player, moves along the waypoints and then it turns back sideways, then towards the player, then sideways, etc. It's kinda cool, adds a bit of difficulty I suppose, but it's not what I wanted.
I tried setframe=50(or 1 or 100 or any number in between) but it seems to sit at frame 1 as it moves along the waypoints no matter what value I set there. Removing that line allows the animation to loop, which is better than not turning to face the player at all, which is what it does when I use setframe. I think this is because the waypoint routine overrides the animation frames - or at least that's what it seems to be doing.
Here's the script I've got so far:
;Artificial Intelligence Script
;Header
desc = target
;Triggers
; Initiate
:state=0:state=1
:state=1:animate=0
:state=1,animationover=1:state=2
:state=2,waypointstate=0:waypointstart
:state=2,waypointstate=3:waypointnext
:state=2,waypointstate=4:waypointrandom
:state=2,waypointstate=5:waypointreverse
;End of Script
Any ideas on how to leave it at frame 50 as it moves along? I suppose I could edit the FPE file and add a second animation from frame 50 to frame 50, and just use Animate=1 but that seems a bit wonky to me - I would think that I should be able to do this all from the FPI script. Hopefully one of you scripting gurus can get me pointed in the right direction.
Thanks for the help guys!
-Phil