; A script Artificial Интелекта
; The author: Nikita (www.fpsc.forum24.ru)
; Date: 04.01.2011
; Requirements: the patch 1.17 and above is necessary.
; The version of a script: 2.0
; The description: the Operated ally (aggressive behaviour!) shoots at the opponent as soon as it will see.
; Management: F - to follow, repeated pressing - stops to follow the player.
; H - allows the order to find the nearest shelter, repeated pressing - cancels the order.
; As it is possible to cancel the order having pressed key F..
; === Animations of movement ===
:idle=1,keypressed=46 0:animate=1 ; - Idle
:movingforwards=1,keypressed=46 0:animate=5,animationnormal,aisetspeed=200 ; - Goes forward costing
:movingbackwards=1,keypressed=46 0:animate=2,animationreverse,aisetspeed=85 ; - Goes back costing
:runningforwards=1,keypressed=46 0:animate=5,animationnormal,aisetspeed=200 ; - Run forward
:idle=1,keypressed=46 1:animate=31 ; - Sit
:movingforwards=1,keypressed=46 1:animate=32,animationnormal,aisetspeed=60 ; - Goes forward siting
:movingbackwards=1,keypressed=46 1:animate=32,animationreverse,aisetspeed=60 ; - Goes back siting
:runningforwards=1,keypressed=46 1:animate=32,animationnormal,aisetspeed=60 ; - Goes forward siting
; === the Beginning of a script ===
:state=0:setaiactive=1,alwaysactive=1,aiatackwareness=1,reloadweapon,state=1
; === Looks at the player if it it is close ===
:state=1:aistop,freeze,setaicleartarget,aiattackawareness=1,aisettarget ; - Costs motionlessly
;:state=1,plrdistwithin=250:rotatetoplr ; - If the player has come close on 250 looks at it
; === Keys of management ===
:state=1,keypressed=35 1:state=5 ; - H.Personazh's key Is pressed looks for shelter
:state=5,keypressed=35 0:state=6
:state=6,keypressed=35 1:state=7,aistop ; - H.Personazh's key is repeatedly pressed stops to look for shelter
:state=7,keypressed=35 0:state=1
:state=6,keypressed=33 1:state=8 ; - key F during execution of order H Is pressed
:state=8,keypressed=33 0:state=3,aistop
:state=3,keypressed=35 1:state=9 ; - key Н during execution of order F Is pressed
:state=9,keypressed=35 0:state=6,aistop
:state=1,keypressed=33 1:state=2,aicleartarget ; - key F Is pressed. The Persian follow for the player
:state=2,keypressed=33 0:state=3
:state=3,keypressed=33 1:state=4 ; - key F is repeatedly pressed. The character ceases to follow the player
:state=4,keypressed=33 0:state=1
; === Follows the player ===
:state=3,plrcannotbeseen:aifollowplr=1,aisettarget ; - Follows the player if it does not see
:state=3,plrdistfurther=60:aifollowplr=1,aisettarget ; - Cледует for the player if it has kept away
:state=3,plrdistwithin=60:aistop ; - Stops, if the player too close
; === Looks for shelter ==
:state=6,etimergreater=2000:state=3
:state=6:aimovetocover=1 ; - Moves to the nearest shelter
:state=6,aiatcover=1:state=1 ; - has found shelter
;///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
; / / // Attack / / / //
; === Shoots at the enemy ===
:state=1,aiaction=1:aiusefullaim=1
:state=1,aiaction=2:aiusefullaim=0
:state=1,aihastarget=0:aiattackawareness=1,aisettarget,airotatetotarget
:state=1,aihastarget=1,aicanshoot=0:setaicleartarget,aiattackawareness=1,aisettarget,airotatetotarget
:state=1,aihastarget=1:setaicleartarget,aiattackawareness=1,aisettarget,airotatetotarget
:state=1,hasweapon=1,ifweapon=1,aicanshoot=1,random=5:useweapon,rundecal=6
:state=3,aiaction=1:aiusefullaim=1
:state=3,aiaction=2:aiusefullaim=0
:state=3,aihastarget=0:aiattackawareness=1,aisettarget,airotatetotarget
:state=3,aihastarget=1,aicanshoot=0:setaicleartarget,aiattackawareness=1,aisettarget,airotatetotarget
:state=3,aihastarget=1:setaicleartarget,aiattackawareness=1,aisettarget,airotatetotarget
:state=3,hasweapon=1,ifweapon=1,aicanshoot=1,aitargetdistfurther=100,random=1:useweapon,rundecal=6
:state=3,hasweapon=1,ifweapon=1,aicanshoot=1,aitargetdistwithin=100:useweapon,rundecal=6
:state=6,aiaction=1:aiusefullaim=1
:state=6,aiaction=2:aiusefullaim=0
:state=6,aihastarget=0:aiattackawareness=1,aisettarget,airotatetotarget
:state=6,aihastarget=1,aicanshoot=0:setaicleartarget,aiattackawareness=1,aisettarget,airotatetotarget
:state=6,aihastarget=1:setaicleartarget,aiattackawareness=1,aisettarget,airotatetotarget
:state=6,hasweapon=1,ifweapon=1,aicanshoot=1:useweapon,rundecal=6
; === Reload (costing) ===
:state=1,ifweapon=0,keypressed=46 0:state=10,setframe=6,aistop,setaiactive=0
:state=3,ifweapon=0,keypressed=46 0:state=11,setframe=6,aistop,setaiactive=0
:state=6,ifweapon=0,keypressed=46 0:state=12,setframe=6,aistop,setaiactive=0
:state=10:incframe=6,aisetspeed=90
:state=10,frameatend=6:reloadweapon,state=1,setaiactive=1
:state=11:incframe=6,aisetspeed=90
:state=11,frameatend=6:reloadweapon,state=3,setaiactive=1
:state=12:incframe=6,aisetspeed=90
:state=12,frameatend=6:reloadweapon,state=6,setaiactive=1
; === Reloadа (siting) ===
:state=1,ifweapon=0,keypressed=46 1:state=13,setframe=36,aistop,setaiactive=0
:state=3,ifweapon=0,keypressed=46 1:state=14,setframe=36,aistop,setaiactive=0
:state=6,ifweapon=0,keypressed=46 1:state=15,setframe=36,aistop,setaiactive=0
:state=13:incframe=36,aisetspeed=90
:state=13,frameatend=36:reloadweapon,state=1,setaiactive=1
:state=14:incframe=36,aisetspeed=90
:state=14,frameatend=36:reloadweapon,state=3,setaiactive=1
:state=15:incframe=36,aisetspeed=90
:state=15,frameatend=36:reloadweapon,state=6,setaiactive=1
Survival mode it is ready, but the manual to it in English is not present.