Quote: "That was a joke"
Why didn't they mention that?
But, I've finally got a script written - two actually, one for standard characters, another with animation info adapted for MP 53. I'm pleased with results. I haven't tested it to see if it works for enemy teams, but I don't see any reason why it wouldn't. If you want a little fun at the expense of a character or two, place an ally with lots of health amongst some enemies and place another ally next to you in another room separated by a corridor, then test it, and have fun watching the guy next to you race off to try to rescue his buddy in the next room.
Standard Character Script:
;Dark AI Artificial Intelligence Script
;NOTE: Some code borrowed from DAI stock "main-weapon" script; the rest was either entirely by me or inspired by EAI's TF341 scripts
;Header
desc = Captain Coder's special DAI script 1
;//SCRIPT "MAP"
;//0-1 = Setup
;//2-9 = Idle
;//10-19 = attack
;//20-29 = reload
;//30-39 = melee 1
;//40-49 = low health - find cover
;Triggers
;--------------------------------------------
;//Animations
;Walking animations
:ducking=0,strafingleft=1:animationnormal,animate=3,resethead
:ducking=0,strafingright=1:animationnormal,animate=4,resethead
:ducking=0,movingforwards=1:animationnormal,animate=2,resethead
:ducking=0,runningforwards=1:animationnormal,animate=5,resethead
:ducking=0,movingbackwards=1:animationreverse,animate=2,resethead
:ducking=0,idle=1:animate=1
;Crouching Animations
:ducking=1,movingforwards=1:animate=32,resethead
:ducking=1,movingbackwards=1:animationreverse,resethead
:ducking=1,strafingleft=1:animate=32,resethead
:ducking=1,movingbackwards=1:animate=32,resethead
:ducking=1,idle=1:animate=31
;--------------------------------------------
;//Always True
;//local var flags default, escort or responder behavior. 0=default, 1=escort (Ally), 911=responder (as in "main-weapon" DAI script that came w/ update 1.17
:always:localvar=1
:state=0:aiusefullaim=1,setvar=0
;//Ally idle- start escort/follow when 'G' is pressed and switch to escort behavior
;//Ally Following stop when 'H' is pressed
:aiteam=1,varequal=0,plrdistwithin=70,plrfacing=10:fpgcrawtextsize=18,fpgcrawtextfont=arial,fpgcrawtextr=200,fpgcrawtextg=200,fpgcrawtextb=200,fpgcrawtextx=50,fpgcrawtexty=10,fpgcrawtext=Press [G] To Recruit Ally
:aiteam=1,varequal=0,plrdistwithin=70,plrfacing=10,etimergreater=200,scancodekeypressed=34 1:etimerstart,setvar=1,sound=audiobank\switches\click.wav,aifollowplr=1
:aiteam=1,varequal=1,plrdistwithin=70,plrfacing=10:fpgcrawtextsize=18,fpgcrawtextfont=arial,fpgcrawtextr=200,fpgcrawtextg=200,fpgcrawtextb=200,fpgcrawtextx=50,fpgcrawtexty=10,fpgcrawtext=Press [H] To Leave Ally
:aiteam=1,varequal=1,plrdistwithin=70,plrfacing=10,etimergreater=200,scancodekeypressed=35 1:etimerstart,setvar=0,sound=audiobank\switches\click.wav,aifollowplr=0
:aiteam=1,varequal=1,plrdistfurther=200:aifollowplr=1
;--------------------------------------------
;//Check if plr called for help (PRESS "H"), if yes, respond
:aiteam=1,scancodekeypressed=35:aiplrcallteam=2000
:aiteam=1,aicalledbyplr=1,aiaction=0:setvar=911
;//free teammate respond to ally call
:varequal=0,aiaction=0,aicalled=5000:airespondtocall,setvar=911
:varequal=911,aicanshoot=1:setvar=0
:varequal=911,idle=1:setvar=0
:varequal=911,shotdamage=1:setvar=0
;--------------------------------------------
;//Start (STATES 0-1)
:state=0:setvar=0,setaiactive=1,alwaysactive=1,reloadweapon,aiattackawareness=1,aiusefullaim=1,state=1
:state=1:state=2,aisettarget,etimerstart
;--------------------------------------------
;//AI Idle - move around at random intervals, look around, watch for enemy, shoot if seen or shot (STATES 2)
:state=1,varequal=0,random=100:aimoverandom
:state=2,aiteam=1,varequal=1,idle=1,plrdistwithin=100,aicanshoot=0,random=100:aimoverandom
:state=2,aiaction=0,random=9:rotateheadrandom=30
:state=2,aicanshoot=1:aisettarget,airotatetotarget,state=10
:state=2,aiheardsound=500:aimovetosound
:state=2,shotdamage=1:aicallteam=2000,state=10
:state=2,healthless=75:state=40
;--------------------------------------------
;//AI Attack & call team (STATE 10)
:state=10:aicallteam=2000
:state=10,ifweapon=1:useweapon,rundecal=6
:state=10,ifweapon=0:state=20
:state=10,targetdistwithin=200:aiaction=9,state=2
:state=10,targetdistfurther=1000:aimovetotarget
;--------------------------------------------
;//AI reload
;//Assess situation (STATE 20)
:state=20,varequal=1,idle=1:aistop,setaiactive=0,aifollowplr=0,state=22
:state=20,varequal=911,idle=1:aistop,setaiactive=0,state=22
:state=20,aitargetdistwithin=120:state=30
:state=20,aiatcover=0,idle=1:aisettarget,state=21,etimerstart
:state=20,aiatcover=1,ducking=0,idle=1:freeze,setaiactive=0,state=22
:state=20,aiatcover=1,ducking=1,idle=1:freeze,setaiactive=0,state=25
:state=20,ducking=0,idle=1:freeze,setaiactive=0,state=22
:state=20,ducking=1,idle=1:freeze,setaiactive=0,state=25
;//Attempt to fall back to cover and reload (STATE 21)
:state=21,aiatcover=0:aimovetocover=0,airotatetotarget
:state=21,aiatcover=1,ducking=0:freeze,setaiactive=0,state=22
:state=21,aiatcover=1,ducking=1:freeze,setaiactive=0,state=25
:state=21,etimergreater=500,idle=1,ducking=0:freeze,setaiactive=0,state=22
:state=21,etimergreater=500,idle=1,ducking=1:freeze,setaiactive=0,state=25
:state=21,etimergreater=2000,ducking=0,random=10:freeze,setaiactive=0,state=22
:state=21,etimergreater=2000,ducking=1,random=10:freeze,setaiactive=0,state=25
:state=21,aitargetdistwithin=70:aistop,state=191
;//Reload standing (STATES 22-24)
:state=22:freeze,setframe=6,state=23
:state=23:freeze,incframe=6
:state=23,framebeyond=6 60:reloadweapon
:state=23,varequal=1,frameatend=6:sound=audiobank\guns\reload.wav
:state=23,frameatend=6:sound=audiobank\guns\reload.wav,state=24
:state=24:state=2,setaiactive=1
;//Reload crouched (STATES 25-27)
:state=25:freeze,setframe=36,state=46
:state=26:freeze,incframe=36
:state=26,framebeyond=36 60:reloadweapon
:state=26,varequal=1,frameatend=36:sound=audiobank\guns\reload.wav
:state=26,frameatend=36:sound=audiobank\guns\reload.wav,state=27
:state=27:state=2,setaiactive=1
;--------------------------------------------
;//Melee Strike (STATES 30-38)
:state=30,varequal=0:state=191
:state=30,varequal=1:state=291
:state=30,varequal=911:state=191
:state=31:aisettarget,airotatetotarget
:state=31,aitargetdistwithin=70,aicanshoot=1:state=32,aistop
:state=31,aitargetdistfurther=70:state=1
:state=31,aicanshoot=0:state=1
:state=32:setaiactive=0,state=33,setframe=8
:state=33:incframe=8,airotatetotarget
:state=33,framebeyond=8 60,aitargetdistwithin=70:aisetmeleedamage=10,aiusemelee=1,state=34,sound=audiobank\misc\melee.wav
:state=33,frameatend=8:animate=1,state=1,setaiactive=1,airotatetotarget
:state=34,frameatend=8:animate=1,state=1,setaiactive=1,airotatetotarget
:state=35:aisettarget,airotatetotarget
:state=35,aitargetdistwithin=70,aicanshoot=1:state=292,aistop
:state=35,aitargetdistfurther=70:state=1,aifollowplr=1
:state=35,aicanshoot=0:state=1,aifollowplr=1
:state=36:setaiactive=0,state=293,setframe=8
:state=37:incframe=8,airotatetotarget
:state=37,framebeyond=8 60,aitargetdistwithin=70:aisetmeleedamage=10,aiusemelee=1,state=294,sound=audiobank\misc\melee.wav
:state=37,frameatend=8:animate=1,state=1,setaiactive=1,airotatetotarget
:state=38,frameatend=8:animate=1,state=1,setaiactive=1,airotatetotarget
;--------------------------------------------
;//AI Move to/at cover - when health < 30, become super alert and
;//contantly call team, shooting enemies and moving away as it sees
;//them until dead
:state=40,healthless=75,healthgreater=29:aiaction=9,state=10
:state=40,healthless=30:aicallteam,aiaction=9,state=41
:state=41,aiaction=2,aicanshoot=0:aicallteam=3000,state=40
:state=41,aiaction=2,aicanshoot=1:settarget,rotatetotarget,aicallteam=3000,useweapon,rundecal=6,state=40
:state=41,aiheardsound=1500,aiaction=2:aicallteam,settarget,state=40
;//Open Doors
:nearactivatable=0:settarget,activatetarget=2
;--------------------------------------------
;//End of script
TF341 Character Script:
;Dark AI Artificial Intelligence Script
;NOTE: Some code borrowed from DAI stock "main-weapon" script; the rest was either entirely by me or inspired by EAI's TF341 scripts
;Header
desc = Captain Coder's special 341 DAI script 1
;//SCRIPT "MAP"
;//0-1 = Setup
;//2-9 = Idle
;//10-19 = attack
;//20-29 = reload
;//30-39 = melee 1
;//40-49 = low health - find cover
;Triggers
;--------------------------------------------
;//Animations
;//Walking animations shoot
:isdarkai=1,aicanshoot=1,ducking=0,strafingleft=1:animationnormal,animate=3,resethead
:isdarkai=1,aicanshoot=1,ducking=0,strafingright=1:animationnormal,animate=4,resethead
:isdarkai=1,aicanshoot=1,ducking=0,movingforwards=1:animationnormal,animate=2,resethead
:isdarkai=1,aicanshoot=1,ducking=0,runningforwards=1:animationnormal,animate=5,resethead
:isdarkai=1,aicanshoot=1,ducking=0,movingbackwards=1:animationreverse,animate=32,resethead
:isdarkai=1,aicanshoot=1,ducking=0,idle=1:animationnormal,animate=1
;//Crouching Animations-shoot
:isdarkai=1,aicanshoot=1,ducking=1,strafingleft=1:animationnormal,animate=32,resethead
:isdarkai=1,aicanshoot=1,ducking=1,strafingright=1:animationnormal,animate=32,resethead
:isdarkai=1,aicanshoot=1,ducking=1,movingforwards=1:animationnormal,animate=32,resethead
:isdarkai=1,aicanshoot=1,ducking=1,movingbackwards=1:animationreverse,animate=32,resethead
:isdarkai=1,aicanshoot=1,ducking=1,idle=1:animationnormal,animate=31
;//Walking animations-no shoot
:isdarkai=1,aicanshoot=0,ducking=0,strafingleft=1:animationnormal,animate=34,resethead
:isdarkai=1,aicanshoot=0,ducking=0,strafingright=1:animationnormal,animate=34,resethead
:isdarkai=1,aicanshoot=0,ducking=0,movingforwards=1:animationnormal,animate=34,resethead
:isdarkai=1,aicanshoot=0,ducking=0,runningforwards=1:animationnormal,animate=40,resethead
:isdarkai=1,aicanshoot=0,ducking=0,movingbackwards=1:animationreverse,animate=34,resethead
:isdarkai=1,aicanshoot=0,ducking=0,idle=1:animationnormal,animate=33
;//Crouching Animations-no shoot
:isdarkai=1,aicanshoot=0,ducking=1,strafingleft=1:animationnormal,animate=34,resethead
:isdarkai=1,aicanshoot=0,ducking=1,strafingright=1:animationnormal,animate=34,resethead
:isdarkai=1,aicanshoot=0,ducking=1,movingforwards=1:animationnormal,animate=34,resethead
:isdarkai=1,aicanshoot=0,ducking=1,movingbackwards=1:animationreverse,animate=34,resethead
:isdarkai=1,aicanshoot=0,ducking=1,idle=1:animationnormal,animate=33
;--------------------------------------------
;//Always True
;//local var flags default, escort or responder behavior. 0=default, 1=escort (Ally), 911=responder (as in "main-weapon" DAI script that came w/ update 1.17
:always:localvar=1
:state=0:aiusefullaim=1,setvar=0
;//Ally idle- start escort/follow when 'G' is pressed and switch to escort behavior
;//Ally Following stop when 'H' is pressed
:aiteam=1,varequal=0,plrdistwithin=70,plrfacing=10:fpgcrawtextsize=18,fpgcrawtextfont=arial,fpgcrawtextr=200,fpgcrawtextg=200,fpgcrawtextb=200,fpgcrawtextx=50,fpgcrawtexty=10,fpgcrawtext=Press [G] To Recruit Ally
:aiteam=1,varequal=0,plrdistwithin=70,plrfacing=10,etimergreater=200,scancodekeypressed=34 1:etimerstart,setvar=1,sound=audiobank\switches\click.wav,aifollowplr=1
:aiteam=1,varequal=1,plrdistwithin=70,plrfacing=10:fpgcrawtextsize=18,fpgcrawtextfont=arial,fpgcrawtextr=200,fpgcrawtextg=200,fpgcrawtextb=200,fpgcrawtextx=50,fpgcrawtexty=10,fpgcrawtext=Press [H] To Leave Ally
:aiteam=1,varequal=1,plrdistwithin=70,plrfacing=10,etimergreater=200,scancodekeypressed=35 1:etimerstart,setvar=0,sound=audiobank\switches\click.wav,aifollowplr=0
:aiteam=1,varequal=1,plrdistfurther=200:aifollowplr=1
;--------------------------------------------
;//Check if plr called for help (PRESS "H"), if yes, respond
:aiteam=1,scancodekeypressed=35:aiplrcallteam=2000
:aiteam=1,aicalledbyplr=1,aiaction=0:setvar=911
;//free teammate respond to ally call
:varequal=0,aiaction=0,aicalled=5000:airespondtocall,setvar=911
:varequal=911,aicanshoot=1:setvar=0
:varequal=911,idle=1:setvar=0
:varequal=911,shotdamage=1:setvar=0
;--------------------------------------------
;//Start (STATES 0-1)
:state=0:setvar=0,setaiactive=1,alwaysactive=1,reloadweapon,aiattackawareness=1,aiusefullaim=1,state=1
:state=1:state=2,aisettarget,etimerstart
;--------------------------------------------
;//AI Idle - move around at random intervals, look around, watch for enemy, shoot if seen or shot (STATES 2)
:state=1,varequal=0,random=100:aimoverandom
:state=2,aiteam=1,varequal=1,idle=1,plrdistwithin=100,aicanshoot=0,random=100:aimoverandom
:state=2,aiaction=0,random=9:rotateheadrandom=30
:state=2,aicanshoot=1:aisettarget,airotatetotarget,state=10
:state=2,aiheardsound=500:aimovetosound
:state=2,shotdamage=1:aicallteam=2000,state=10
:state=2,healthless=75:state=40
;--------------------------------------------
;//AI Attack & call team (STATE 10)
:state=10:aicallteam=2000
:state=10,ifweapon=1:useweapon,rundecal=6
:state=10,ifweapon=0:state=20
:state=10,targetdistwithin=200:aiaction=9,state=2
:state=10,targetdistfurther=1000:aimovetotarget
;--------------------------------------------
;//AI reload
;//Assess situation (STATE 20)
:state=20,varequal=1,idle=1:aistop,setaiactive=0,aifollowplr=0,state=22
:state=20,varequal=911,idle=1:aistop,setaiactive=0,state=22
:state=20,aitargetdistwithin=120:state=30
:state=20,aiatcover=0,idle=1:aisettarget,state=21,etimerstart
:state=20,aiatcover=1,ducking=0,idle=1:freeze,setaiactive=0,state=22
:state=20,aiatcover=1,ducking=1,idle=1:freeze,setaiactive=0,state=25
:state=20,ducking=0,idle=1:freeze,setaiactive=0,state=22
:state=20,ducking=1,idle=1:freeze,setaiactive=0,state=25
;//Attempt to fall back to cover and reload (STATE 21)
:state=21,aiatcover=0:aimovetocover=0,airotatetotarget
:state=21,aiatcover=1,ducking=0:freeze,setaiactive=0,state=22
:state=21,aiatcover=1,ducking=1:freeze,setaiactive=0,state=25
:state=21,etimergreater=500,idle=1,ducking=0:freeze,setaiactive=0,state=22
:state=21,etimergreater=500,idle=1,ducking=1:freeze,setaiactive=0,state=25
:state=21,etimergreater=2000,ducking=0,random=10:freeze,setaiactive=0,state=22
:state=21,etimergreater=2000,ducking=1,random=10:freeze,setaiactive=0,state=25
:state=21,aitargetdistwithin=70:aistop,state=191
;//Reload standing (STATES 22-24)
:state=22:freeze,setframe=6,state=23
:state=23:freeze,incframe=6
:state=23,framebeyond=6 60:reloadweapon
:state=23,varequal=1,frameatend=6:sound=audiobank\guns\reload.wav
:state=23,frameatend=6:sound=audiobank\guns\reload.wav,state=24
:state=24:state=2,setaiactive=1
;//Reload crouched (STATES 25-27)
:state=25:freeze,setframe=36,state=46
:state=26:freeze,incframe=36
:state=26,framebeyond=36 60:reloadweapon
:state=26,varequal=1,frameatend=36:sound=audiobank\guns\reload.wav
:state=26,frameatend=36:sound=audiobank\guns\reload.wav,state=27
:state=27:state=2,setaiactive=1
;----------------------------------------------
;//Melee Strike (STATES 30-38)
:state=30,varequal=0:state=191
:state=30,varequal=1:state=291
:state=30,varequal=911:state=191
:state=31:aisettarget,airotatetotarget
:state=31,aitargetdistwithin=70,aicanshoot=1:state=32,aistop
:state=31,aitargetdistfurther=70:state=1
:state=31,aicanshoot=0:state=1
:state=32:setaiactive=0,state=33,setframe=8
:state=33:incframe=8,airotatetotarget
:state=33,framebeyond=8 60,aitargetdistwithin=70:aisetmeleedamage=10,aiusemelee=1,state=34,sound=audiobank\misc\melee.wav
:state=33,frameatend=8:animate=1,state=1,setaiactive=1,airotatetotarget
:state=34,frameatend=8:animate=1,state=1,setaiactive=1,airotatetotarget
:state=35:aisettarget,airotatetotarget
:state=35,aitargetdistwithin=70,aicanshoot=1:state=292,aistop
:state=35,aitargetdistfurther=70:state=1,aifollowplr=1
:state=35,aicanshoot=0:state=1,aifollowplr=1
:state=36:setaiactive=0,state=293,setframe=8
:state=37:incframe=8,airotatetotarget
:state=37,framebeyond=8 60,aitargetdistwithin=70:aisetmeleedamage=10,aiusemelee=1,state=294,sound=audiobank\misc\melee.wav
:state=37,frameatend=8:animate=1,state=1,setaiactive=1,airotatetotarget
:state=38,frameatend=8:animate=1,state=1,setaiactive=1,airotatetotarget
;-----------------------------------------------
;//AI Move to/at cover - when health < 30, become super alert and
;//contantly call team, shooting enemies and moving away as it sees
;//them until dead
:state=40,healthless=75,healthgreater=29:aiaction=9,state=10
:state=40,healthless=30:aicallteam,aiaction=9,state=41
:state=41,aiaction=2,aicanshoot=0:aicallteam=3000,state=40
:state=41,aiaction=2,aicanshoot=1:settarget,rotatetotarget,aicallteam=3000,useweapon,rundecal=6,state=40
:state=41,aiheardsound=1500,aiaction=2:aicallteam,settarget,state=40
;//Open Doors
:nearactivatable=0:settarget,activatetarget=2
;-----------------------------------------------
;//End of script
@Akanto10: I forgot to make the characters non-DAI to make them work. When I fixed that, they worked for a little while, but eventually stopped working. I ran up to them and shot them in the head and they just stood there. Has anyone else had this problem?
Thanks and enjoy,
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