I have a problem with conditions out of state. Let me explain what I mean. Conditions like ALWAYS or WAYPOINTSTATE without a STATE condition in front of it. It seems like its, unstructured programming. Kind of like basic with a lot of goto’s. I have found here on the forum quite of few scripts that use the ALWAYS condition and found them to work better by changing them to a STATE condition.
I have been toying around with waypoints and come up with this little script. It’s not much but I think it a good beginning. The character will remain still until it sees the player. Then it will start following the waypoint until it reaches the end and stop. By adding to the script the possibilities or endless. Correct me if I’m wrong (and you probably will) but I think this will give you much more control. So without further ado here’s the script.
;Artificial Intelligence Script
;Header
; follow2end.fpi
desc = Follow Waypoints to End
;Triggers
:state=0,plrcanbeseen=0:state=1
:state=1,plrcanbeseen:waypointstart,state=2
:state=2,waypointstate=1:animate=2
:state=2,waypointstate=3:animate=2,waypointnext
:state=2,waypointstate=4:animate=2,waypointrandom
:state=2,waypointstate=5:animate=1,waypointstop,state=3
;End of Script
Put the script in your FPS Creator\Files\scriptbank\people folder. Attached is the fpm file i used to test this.
BTW: Please be gentle with me. I have been programming many years. But I am new to FPSC Scripting. Oh it would appear the plrcanbeseen condition initializes true.
Thank you.