Here is a
;Artificial Intelligence Script
;Header
desc = puppet script
;Triggers
:state=0:settargetname=isshot,state=1
:state=1,scancodekeypressed=33:state=3
:state=1,scancodekeypressed=35:state=4
:state=1,scancodekeypressed=20:state=5
:state=1,scancodekeypressed=19:state=6
:state=1,scancodekeypressed=34:state=7
:state=1,scancodekeypressed=49:state=8
:state=1,scancodekeypressed=50:state=9
:state=1,scancodekeypressed=54:rotatetotarget,state=10
:state=2,scancodekeypressed=0:animate=1,state=1
:state=3:animate=2,rotateiy=-3
:state=3,scancodekeypressed=0:animate=1,state=1
:state=4:animate=2,rotateiy=3
:state=4,scancodekeypressed=0:animate=1,state=1
:state=5:animate=2,movefore=2,dropmarker
:state=5,scancodekeypressed=33:rotateiy=-3
:state=5,scancodekeypressed=35:rotateiy=3
:state=5,scancodekeypressed=0:animate=1,state=1
:state=6:animate=5,runfore=2
:state=6,scancodekeypressed=33:rotateiy=-3
:state=6,scancodekeypressed=35:rotateiy=3
:state=6,scancodekeypressed=0:animate=1,state=1
:state=7:animate=2,rotatetoplr,nextmarker
:state=7,scancodekeypressed=33:rotateiy=-3
:state=7,scancodekeypressed=35:rotateiy=3
:state=7,scancodekeypressed=0:animate=1,state=1
:state=8:rotatehead=-30
:state=8,scancodekeypressed=0:animate=1,resethead,state=1
:state=9:rotatehead=30
:state=9,scancodekeypressed=0:animate=1,resethead,state=1
:state=10,ifweapon=1,rateoffire:useweapon,rundecal=6
:state=10,ifweapon=0:state=11,setframe=6
:state=10,scancodekeypressed=0:state=1
:state=11,:incframe=6
:state=11,frameatend=6:state=1,reloadweapon,sound=audiobank\guns\reload.wav
;End of Script
that I wrote for a puppet script that shoots an enemy.
The enemy is named
isshot for this example script. (set in state=0 initialization state)
The script uses the Right-Shift key (scancodekeypressed=54) to shoot the enemy.
Here is the link to the
Puppet Script Thread if you want it...
Controls
'R' = run forward
'T' = walk forward
'F' = turn left
'H' = turn right
'G' = retrace steps
'N' = Rotate head left
'M' = Rotate head right
'Right-Shift' = Shoot an Enemy named isshot
There are the controls if you want to play around with it.
Here is how you set it up...
1) Place a character with a gun and assign him the puppetshooter script (your new script) to his AI MAIN
Also edit his rate of fire to 100
2) Place a character without a gun to get shot and change his name to isshot
You can adjust his health lower than 100 also if you wish for a faster death
3) Have fun using the right shift key to shoot!
Hope this helps get you started.
States 10 & 11 are the ones you will be most interested in.