My take after playing around with it some is that choosestrafe simply chooses a direction. However, I found that it will make the enemy do some strange moves when used with the other two commands. It seems to me that you assign a value to strafe= and when the command strafe is encountered it will use the same value as the previous assignment. For example I modified strafe10.fpi. See code snippet. Go to the state 10 and you will see that I randomly assign strafe to different values and then also randomly used just strafe, so whatever value was assigned just prior to that it should use it again. I assume. I also changed
:state=9,plrcannotbeseen:state=10
to
:state=9,plrcanbeseen:state=10
just to add a lot of movement.
From what I've seen in using choosestrafe (maybe one needs to place it just right) is that the enemy will turn away from the player and yet is still firing the weapon. An odd move.
;Artificial Intelegence Script
;Header
desc = modified Strafe While Shooting
;Triggers
:state=0,ifweapon=0:state=8,setframe=6
:plrcanbeseen:settarget,rotatetotarget,rotatetoplr,resethead
:plrdistwithin=200:rotatetoplr,resethead
:state=0,random=20:state=9
:state=0,shotdamage=1:rotatetoplr,state=7
:state=0,noiseheard=5:settarget,rotatetotarget,rotatetoplr,strafe,state=7
:state=0,ifweapon=1,plrcanbeseen:state=2
:state=1:incframe=3,strafe=-90,rotatetoplr
:state=1,ifweapon=1,plrcanbeseen:useweapon,rundecal=6
:state=1,frameatend=3:state=0,animate=1
:state=5:useweapon,rundecal=6,state=0
:state=4:state=5
:state=3:state=4
:state=2:state=3
:state=6:incframe=4,strafe=90,rotatetoplr
:state=6,ifweapon=1,plrcanbeseen:useweapon,rundecal=6
:state=6,frameatend=4:state=0,animate=1
:state=7,random=1:state=6,setframe=4
:state=7:state=1,setframe=3
:state=8:incframe=6
:state=8,frameatend=6:state=0,reloadweapon,sound=audiobank\guns\reload.wav
:state=9,plrcanbeseen:state=10
:state=9:state=0
:state=10,random=1:rotatetoplr,strafe=-90
:state=10,random=1:rotatetoplr,strafe
:state=10,random=1:rotatetoplr,strafe=135
:state=10,random=1:rotatetoplr,strafe
:state=10,random=1:rotatetoplr,strafe=60
:state=10,random=1:rotatetoplr,strafe
:state=10,random=1:rotatetoplr,strafe=-60
:state=10:state=7
;End of Script
Give this code a shot (no pun intended), put the enemies health to 500. I used the characters from SciFi with a heavy weapon. The enemy seems to be moving all the time with this.
The past has a lot of memories to hold onto; but, today is chock full of new adventures, and, the future shouts out, "The best is yet to come!" -- TerryC