@sic1ne
Here are the fixed scripts:
Ched80_ThirdPerson_Main:
;Artificial Intelligence Script
;Created by Ched80 2012.04.19
;Credit to The Zombie Killer for reference scripts
;Controls Character using Player's Cam
;Edited by The Zombie Killer 2012.05.19
;Header
desc = Third Person by Ched80 Edited by TZK
;Triggers
;Variables are initialised in the appear scripts
;HUD Image
:state=0:hudreset,hudx=50,hudy=50,hudimage=gamecore\guns\scifi\assaultrifle\crosshair.dds,hudname=CrosshairHUD,hudhide=0,hudmake=display
;Uncomment next line to enable debugging
;:state=0:hudreset,hudx=50,hudy=8,hudsizex=16,hudsizey=18,hudimage=gamecore\huds\numeric1.tga,hudname=TestHUD2,hudtype=6,huduservar=PlrAngle,hudhide=0,hudmake=numeric
:state=0:state=1,etimerstart
;Always
:always:aisettarget,activate=147
;Variables
:always:setvar=$PH $EH,setvar=PlrShooting 0
:always:setvar=PPX $EPX,setvar=PPY $EPY,setvar=PPZ $EPZ
:hasweapon=1:setvar=GunAmmo $EA
:vargreater=GunAmmo %PlrAmmo:setvar=GunAmmo %PlrAmmo
:varless=PlrAmmo 0:setvar=PlrAmmo 0
:varless=CamDist %CamDistTarget:addvar=CamDist 0.75
:vargreater=CamDist %CamDistTarget:subvar=CamDist 0.75
:varequal=AgainstWall 0:setvar=CastBack %CamDist,mulvar=CastBack -1.4
:always:setvar=AgainstWall 0
:varless=CamFovOffset %CFOTarget:addvar=CamFovOffset 0.75
:vargreater=CamFovOffset %CFOTarget:subvar=CamFovOffset 0.75
:varless=CamYOffset %CYOTarget:addvar=CamYOffset 0.75
:vargreater=CamYOffset %CYOTarget:subvar=CamYOffset 0.75
;Camera Position & Field of View
:state=1:entrotatey=$CAY,setvar=$CAY $EAY,rotateiy=0
:state=60:plrpointatobject=0
:state=1:setvar=PlrPosX $EAY,setvar=PlrPosZ $EAY
:state=1:sin=PlrPosX,cos=PlrPosZ
:raycastback=0 %CastBack:setvar=AgainstWall 1
:varequal=AgainstWall 1:divvar=CamDist 2,setvar=CamDistTarget %CamDist
:state=1:mulvar=PlrPosX %CamDist,mulvar=PlrPosZ %CamDist
:always:plrcamoffsetx=%PlrPosX,plrcamoffsety=%CamYOffset,plrcamoffsetz=%PlrPosZ
:always:setvar=$CPX $EPX,setvar=$CPY $EPY,setvar=$CPZ $EPZ
:state=1,varequal=Crouching 0:setvar=CYOTarget 35
:state=1,varequal=Crouching 1:setvar=CYOTarget 25
:state=1,plrrunning:setvar=CYOTarget 35
:state=1:camfov=%CamFovOffset
;Level Interaction
:nearactivatable=0,keypressed=28 1:settarget,activatetarget=2
:shotdamage=2:bloodspurt=1,setvar=Status 6
:shotdamage=2,random=2:bloodsplash=50
:always:nobulletcol=0,plrsetimmune=0
;Character Animations
;Crouching
:state=1,keypressed=46 1:setvar=Crouching 1
:state=1,keypressed=46 0:setvar=Crouching 0
;Idle
:state=1,varequal=Crouching 0,keypressed=17 0,keypressed=30 0,keypressed=31 0,keypressed=32 0:setvar=CamDistTarget -25,setvar=CFOTarget 0,animate=1
:state=1,varequal=Crouching 1,keypressed=17 0,keypressed=30 0,keypressed=31 0,keypressed=32 0:setvar=CamDistTarget -25,setvar=CFOTarget 0,animate=31
;Walk Forward
:state=1,varequal=Crouching 0,plrnotrunning,keypressed=17 1,keypressed=30 0,keypressed=31 0,keypressed=32 0:setvar=CamDistTarget -30,setvar=CFOTarget 0,animationnormal,animate=2,movefore=1
:state=1,varequal=Crouching 1,plrnotrunning,keypressed=17 1,keypressed=30 0,keypressed=31 0,keypressed=32 0:setvar=CamDistTarget -30,setvar=CFOTarget 0,animationnormal,animate=32,movefore=1
;Run Forward
:state=1,varequal=Crouching 0,plrrunning,keypressed=17 1,keypressed=30 0,keypressed=31 0,keypressed=32 0:setvar=CamDistTarget -50,setvar=CFOTarget -20,animationnormal,animate=5,runfore=1
:state=1,varequal=Crouching 1,plrrunning,keypressed=17 1,keypressed=30 0,keypressed=31 0,keypressed=32 0:setvar=CamDistTarget -50,setvar=CFOTarget -20,animationnormal,animate=35,runfore=1
;Walk Back
:state=1,varequal=Crouching 0,plrnotrunning,keypressed=17 0,keypressed=30 0,keypressed=31 1,keypressed=32 0:setvar=CamDistTarget -20,setvar=CFOTarget 0,animationreverse,animate=2,strafe=180,rotateiy=0
:state=1,varequal=Crouching 1,plrnotrunning,keypressed=17 0,keypressed=30 0,keypressed=31 1,keypressed=32 0:setvar=CamDistTarget -20,setvar=CFOTarget 0,animationreverse,animate=32,strafe=180,rotateiy=0
;Run Back
:state=1,varequal=Crouching 0,plrrunning,keypressed=17 0,keypressed=30 0,keypressed=31 1,keypressed=32 0:setvar=CamDistTarget -10,setvar=CFOTarget 0,animationreverse,animate=5,strafe=180,rotateiy=0
:state=1,varequal=Crouching 1,plrrunning,keypressed=17 0,keypressed=30 0,keypressed=31 1,keypressed=32 0:setvar=CamDistTarget -10,setvar=CFOTarget 0,animationreverse,animate=35,strafe=180,rotateiy=0
;Strafe Left
:state=1,varequal=Crouching 0,keypressed=17 0,keypressed=30 1,keypressed=31 0,keypressed=32 0:setvar=CamDistTarget -25,setvar=CFOTarget 0,animationnormal,animate=3,strafe=-90,rotateiy=0
:state=1,varequal=Crouching 1,keypressed=17 0,keypressed=30 1,keypressed=31 0,keypressed=32 0:setvar=CamDistTarget -25,setvar=CFOTarget 0,animationnormal,animate=33,strafe=-90,rotateiy=0
;Strafe Right
:state=1,varequal=Crouching 0,keypressed=17 0,keypressed=30 0,keypressed=31 0,keypressed=32 1:setvar=CamDistTarget -25,setvar=CFOTarget 0,animationnormal,animate=4,strafe=90,rotateiy=0
:state=1,varequal=Crouching 1,keypressed=17 0,keypressed=30 0,keypressed=31 0,keypressed=32 1:setvar=CamDistTarget -25,setvar=CFOTarget 0,animationnormal,animate=34,strafe=90,rotateiy=0
;Shooting
:state=1,mousestate=1,hasweapon=1,ifweapon=1,vargreater=PlrAmmo 0.5:nobulletcol=1,plrsetimmune=1,useweapon=0,camshake=4,setvar=PlrShooting 1,subvar=PlrAmmo 1,sound=gamecore\guns\scifi\assaultrifle\fire.wav
:state=1,mousestate=1,hasweapon=1,ifweapon=0,vargreater=PlrAmmo 0.5:state=60,animationnormal,animate=6,setvar=PlrAngle $EAY
:state=1,mousestate=1,hasweapon=1,ifweapon=0,varless=PlrAmmo 0.5:nobulletcol=1,plrsetimmune=1,animationnormal,animate=1,sound=gamecore\guns\scifi\assaultrifle\dryfire.wav
;Melee if no weapon
:state=1,mousestate=1,hasweapon=0:state=70,animationnormal,animate=6
:state=70,animationover=6:state=1
;Reloading
:state=1,keypressed=19 1,hasweapon=1,vargreater=PlrAmmo 0:state=60,animationnormal,animate=6,sound=gamecore\guns\scifi\assaultrifle\reload.wav
:state=60,animationover=6:reloadweapon,state=1,plrdisable=0
;Strafe Left + Strafe Right (Bug Fix)
:state=1,varequal=Crouching 0,keypressed=17 0,keypressed=30 1,keypressed=31 0,keypressed=32 1:setvar=CamDistTarget -25,setvar=CFOTarget 0,animationnormal,animate=1,strafe=0,rotateiy=0
:state=1,varequal=Crouching 1,keypressed=17 0,keypressed=30 1,keypressed=31 0,keypressed=32 1:setvar=CamDistTarget -25,setvar=CFOTarget 0,animationnormal,animate=31,strafe=0,rotateiy=0
;Walk\Run Forward + Walk\Run Back (Bug Fix)
:state=1,varequal=Crouching 0,keypressed=17 1,keypressed=30 0,keypressed=31 1,keypressed=32 0:setvar=CamDistTarget -25,setvar=CFOTarget 0,animationnormal,animate=1,strafe=0,rotateiy=0
:state=1,varequal=Crouching 1,keypressed=17 1,keypressed=30 0,keypressed=31 1,keypressed=32 0:setvar=CamDistTarget -25,setvar=CFOTarget 0,animationnormal,animate=31,strafe=0,rotateiy=0
;Walk\Run Forward + Walk\Run Back + Strafe Left + Strafe Right (Bug Fix)
:state=1,varequal=Crouching 0,keypressed=17 1,keypressed=30 1,keypressed=31 1,keypressed=32 1:setvar=CamDistTarget -25,setvar=CFOTarget 0,animationnormal,animate=1,strafe=0,rotateiy=0
:state=1,varequal=Crouching 1,keypressed=17 1,keypressed=30 1,keypressed=31 1,keypressed=32 1:setvar=CamDistTarget -25,setvar=CFOTarget 0,animationnormal,animate=31,strafe=0,rotateiy=0
;Strafe Left + Walk Forward
:state=1,varequal=Crouching 0,plrnotrunning,keypressed=17 1,keypressed=30 1,keypressed=31 0,keypressed=32 0:setvar=CamDistTarget -30,setvar=CFOTarget 0,animationnormal,animate=2,movefore=1,strafe=-45
:state=1,varequal=Crouching 1,plrnotrunning,keypressed=17 1,keypressed=30 1,keypressed=31 0,keypressed=32 0:setvar=CamDistTarget -30,setvar=CFOTarget 0,animationnormal,animate=32,movefore=1,strafe=-45
;Strafe Left + Run Forward
:state=1,varequal=Crouching 0,plrrunning,keypressed=17 1,keypressed=30 1,keypressed=31 0,keypressed=32 0:setvar=CamDistTarget -30,setvar=CFOTarget 0,animationnormal,animate=5,runfore=1,strafe=-45
:state=1,varequal=Crouching 1,plrrunning,keypressed=17 1,keypressed=30 1,keypressed=31 0,keypressed=32 0:setvar=CamDistTarget -30,setvar=CFOTarget 0,animationnormal,animate=35,runfore=1,strafe=-45
;Strafe Right + Walk Forward
:state=1,varequal=Crouching 0,plrnotrunning,keypressed=17 1,keypressed=30 0,keypressed=31 0,keypressed=32 1:setvar=CamDistTarget -30,setvar=CFOTarget 0,animationnormal,animate=2,movefore=1,strafe=45
:state=1,varequal=Crouching 1,plrnotrunning,keypressed=17 1,keypressed=30 0,keypressed=31 0,keypressed=32 1:setvar=CamDistTarget -30,setvar=CFOTarget 0,animationnormal,animate=32,movefore=1,strafe=45
;Strafe Right + Run Forward
:state=1,varequal=Crouching 0,plrrunning,keypressed=17 1,keypressed=30 0,keypressed=31 0,keypressed=32 1:setvar=CamDistTarget -30,setvar=CFOTarget 0,animationnormal,animate=5,runfore=1,strafe=45
:state=1,varequal=Crouching 1,plrrunning,keypressed=17 1,keypressed=30 0,keypressed=31 0,keypressed=32 1:setvar=CamDistTarget -30,setvar=CFOTarget 0,animationnormal,animate=35,runfore=1,strafe=45
;Strafe Left + Walk Back
:state=1,varequal=Crouching 0,plrnotrunning,keypressed=17 0,keypressed=30 1,keypressed=31 1,keypressed=32 0:setvar=CamDistTarget -30,setvar=CFOTarget 0,animationnormal,animate=2,movefore=-1,strafe=45
:state=1,varequal=Crouching 1,plrnotrunning,keypressed=17 0,keypressed=30 1,keypressed=31 1,keypressed=32 0:setvar=CamDistTarget -30,setvar=CFOTarget 0,animationnormal,animate=32,movefore=-1,strafe=45
;Strafe Left + Run Back
:state=1,varequal=Crouching 0,plrrunning,keypressed=17 0,keypressed=30 1,keypressed=31 1,keypressed=32 0:setvar=CamDistTarget -30,setvar=CFOTarget 0,animationnormal,animate=5,runfore=-1,strafe=45
:state=1,varequal=Crouching 1,plrrunning,keypressed=17 0,keypressed=30 1,keypressed=31 1,keypressed=32 0:setvar=CamDistTarget -30,setvar=CFOTarget 0,animationnormal,animate=35,runfore=-1,strafe=45
;Strafe Right + Walk Back
:state=1,varequal=Crouching 0,plrnotrunning,keypressed=17 0,keypressed=30 0,keypressed=31 1,keypressed=32 1:setvar=CamDistTarget -30,setvar=CFOTarget 0,animationnormal,animate=2,movefore=-1,strafe=-45
:state=1,varequal=Crouching 1,plrnotrunning,keypressed=17 0,keypressed=30 0,keypressed=31 1,keypressed=32 1:setvar=CamDistTarget -30,setvar=CFOTarget 0,animationnormal,animate=32,movefore=-1,strafe=-45
;Strafe Right + Run Back
:state=1,varequal=Crouching 0,plrrunning,keypressed=17 0,keypressed=30 0,keypressed=31 1,keypressed=32 1:setvar=CamDistTarget -30,setvar=CFOTarget 0,animationnormal,animate=5,runfore=-1,strafe=-45
:state=1,varequal=Crouching 1,plrrunning,keypressed=17 0,keypressed=30 0,keypressed=31 1,keypressed=32 1:setvar=CamDistTarget -30,setvar=CFOTarget 0,animationnormal,animate=35,runfore=-1,strafe=-45
;Near door
:nearactivatable=80:setvar=CamDistTarget -10
;Camera against wall
:varequal=AgainstWall 1:setvar=CamDistTarget %CamDist
;End of Script
Ched80_ThirdPerson_Appear2.fpi:
;Artificial Intelligence Script
;Created by Ched80 2012.05.08
;Sets variables for player character to speed up script
;Header
desc = Third Person by Ched80 Variables
;Triggers
;Set Up Variables
:state=0:dimvar=PlrAmmo,setvar=PlrAmmo 30
:state=0:dimvar=GunAmmo,setvar=GunAmmo 0
:state=0:dimvar=Crouching,setvar=Crouching 0
:state=0:dimvar=PlrYAngle,setvar=PlrYAngle $EAY
:state=0:dimvar=PlrXAngle,setvar=PlrXAngle $EAX
:state=0:dimvar=PlrPosX,setvar=PlrPosX 0
:state=0:dimvar=PlrPosZ,setvar=PlrPosZ 0
:state=0:dimvar=PlrAngle,dimvar=LastAngle,dimvar=PlrShooting
:state=0:dimvar=CamDist,setvar=CamDist -25
:state=0:dimvar=CastBack,setvar=CastBack -50
:state=0:dimvar=AgainstWall
:state=0:dimvar=CamDistTarget,setvar=CamDistTarget -50
:state=0:dimvar=CamFovOffset,setvar=CamFovOffset 0
:state=0:dimvar=CFOTarget,setvar=CFOTarget 0
:state=0:dimvar=CamYOffset,setvar=CamYOffset 65
:state=0:dimvar=CYOTarget,setvar=CYOTarget 65
:state=0:dimvar=Strafing,setvar=Strafing 0
:state=0:dimvar=PPX,dimvar=PPY,dimvar=PPZ
;Set Up Actions
:state=0:jumpkey=0,peekkey=0,crouchkey=0
;Set Up Camera
:state=0:plrcamoffseton=1
;Appear Routine
:state=0:state=1,setalphafade=0,animate=1
:state=1,alphafadeequal=0:incalphafade=100
:state=1,alphafadeequal=100:state=2,addaiteam=1,runfpidefault=1
;End of Script
-TZK