Hello scripters,
I wrote up this script, and tested it (when FPSC was working on my PC).
Here's my problem: The character will strafe to the right and shoot at the same time (from the player's point of view) like he is supposed to. However, he will keep strafing even when he runs out of ammo. He will also keep running the weapon-firing decal. He is supposed to stop, crouch down, reload, stand up, and keep firing and strafing back and forth. So here are the problems:
Script Problems Summary
Will not stop strafing
Will not strafe back and forth
Firing decal does not stop when out of ammo
Will only reload when shot at
I think that covers everything. Here is the script:
;Artificial Intelligence Script
;Header
;Written by Captain Coder
;For use in commercial and noncommercial games
desc = Smart AI for character
;Triggers
:state=0:state=1
:state=1,ifweapon=0:state=15
:state=1,ifweapon=1:state=2
;/////Character watching for plr\\\\\
:state=2:rotatetoplr
:state=2,plrcanbeseen:state=3
:state=2,shotdamage=1:state=5
;/////Character can see plr, shoot him!\\\\\
:state=3:settarget,rotatetotarget,useweapon,rundecal=6
:state=3,plrcannotbeseen:state=5
:state=3,shotdamage=1:state=5
;/////Strafe back and forth while shooting\\\\\
:state=5:incframe=3,strafe=-90,rotatetoplr
:state=5,ifweapon=1,plrcanbeseen:useweapon,rundecal=6
:state=5,frameatend=3,ifweapon=1:state=6
:state=5,frameatend=3,ifweapon=0:state=15
:state=6:incframe=4,strafe=90,rotatetoplr
:state=6,ifweapon=1,plrcanbeseen:useweapon,rundecal=6
:state=6,frameatend=4,ifweapon=1:state=2,animate=51
:state=6,frameatend=4,ifweapon=0:state=15
;/////Take cover and reload\\\\\
:state=15:rotatetoplr,animate=31,state=16
:state=16:incframe=36
:state=16,frameatend=36:animate=51,state=2,reloadweapon,sound=audiobank\guns\reload.wav
;End of Script
Thank you,
Captain Coder
One of the most humbling days in your life will be the day you discover you AREN'T the best at what you love to do.
- Me