Hey everybody. As the title says, I'm having troubles with the command script for my hallway turrets.
Here is the command script code(Please don't use this code in a commercial or contest-entry game without my express permission):
;Dar13's Hallway Turret Command Ceneter Script
;Header
desc = Hallway turret setup command script
;Triggers
:state=0:dimvar=TrtAlive1,dimvar=TrtAlive2,dimvar=TrtAlive3,setvar=TrtAlive1 1,setvar=TrtAlive2 1,setvar=TrtAlive3 1,dimvar=3TrtSys,dimvar=2TrtSys,dimvar=LS,activate=1
:state=0,activated=1,plrwithinzone=1:activate=20,state=1
:state=1:settargetname=hllwypt1,activatetarget=1
:state=1,activated=20:setvar=TrtAlive1 1,setvar=TrtAlive2 1,setvar=TrtAlive3 1,setvar=3TrtSys 1,setvar=2TrtSys 0,setvar=LS 0,activate=0
;if activated by the entity in its death throes, set the entities devoted variable's status to "dead"
:activated=7:setvar=TrtAlive1 0
:activated=8:setvar=TrtAlive2 0
:activated=9:setvar=TrtAlive3 0
;check and set variables to determine whether the script is in 3Turret/2Turret/LastStand mode
:varequal=TrtAlive1 1,varequal=TrtAlive2 1,varequal=TrtAlive3 1:setvar=3TrtSys 1,setvar=2TrtSys 0,setvar=LS 0
:varequal=TrtAlive1 0,varequal=TrtAlive2 1,varequal=TrtAlive3 1:setvar=3TrtSys 0,setvar=2TrtSys 1,setvar=LS 0
:varequal=TrtAlive2 0,varequal=TrtAlive1 1,varequal=TrtAlive3 1:setvar=3TrtSys 0,setvar=2TrtSys 1,setvar=LS 0
:varequal=TrtAlive3 0,varequal=TrtAlive1 1,varequal=TrtAlive2 1:setvar=3TrtSys 0,setvar=2TrtSys 1,setvar=LS 0
:varequal=TrtAlive1 0,varequal=TrtAlive2 0,varequal=TrtAlive3 1:setvar=2TrtSys 0,setvar=3TrtSys 0,setvar=LS 1
:varequal=TrtAlive2 0,varequal=TrtAlive3 0,varequal=TrtAlive1 1:setvar=2TrtSys 0,setvar=3TrtSys 0,setvar=LS 1
:varequal=TrtAlive3 0,varequal=TrtAlive1 0,varequal=TrtAlive2 1:setvar=2TrtSys 0,setvar=3TrtSys 0,setvar=LS 1
:varequal=TrtAlive1 0,varequal=TrtAlive2 0,varequal=TrtAlive3 0:suspend
;for a 3Turret mode(subscript)
:varequal=3TrtSys 1:state=2
:state=2,varequal=3TrtSys 1:settargetname=hllwypt1,activatetarget=1,state=3
:state=2,varequal=3TrtSys 0,varequal=2TrtSys 1:state=6
:state=3,varequal=3TrtSys 1,activated=1:settargetname=hllwypt2,activatetarget=1,activate=0,state=4
:state=3,varequal=3TrtSys 0,varequal=2TrtSys 1:state=6
:state=4,varequal=3TrtSys 1,activated=3:settargetname=hllwypt3,activatetarget=1,activate=0,state=5
:state=4,varequal=3TrtSys 0,varequal=2TrtSys 1:state=6
:state=5,activated=5:activate=0,state=2
;end of subscript
;for a 2Turret mode(subscript)
:varequal=2TrtSys 1:state=6
:state=6,varequal=2TrtSys 1,varequal=TrtAlive1 1,varequal=TrtAlive2 1:state=7
:state=6,varequal=2TrtSys 1,varequal=TrtAlive1 1,varequal=TrtAlive3 1:state=10
:state=6,varequal=2TrtSys 1,varequal=TrtAlive2 1,varequal=TrtAlive3 1:state=13
;if turrets 1 & 2 are alive
:state=7,varequal=2TrtSys 1:settargetname=hllwypt2,activatetarget=2,state=8
:state=7,varequal=2TrtSys 0,varequal=LS 1:state=16
:state=8,varequal=2TrtSys 1,activated=4:settargetname=hllwypt1,activatetarget=2,activate=0,state=9
:state=8,varequal=2TrtSys 0,varequal=LS 1:state=16
:state=9,varequal=2TrtSys 1,activated=2:activate=0,state=7
:state=9,varequal=2TrtSys 0,varequal=LS 1:state=16
;if turrets 2 & 3 are alive
:state=10,varequal=2TrtSys 1:settargetname=hllwypt2,activatetarget=2,state=11
:state=10,varequal=2TrtSys 0,varequal=LS 1:state=16
:state=11,varequal=2TrtSys 1,activated=4:settargetname=hllwypt3,activatetarget=2,activate=0,state=12
:state=11,varequal=2TrtSys 0,varequal=LS 1:state=16
:state=12,varequal=2TrtSys 1,activated=6:activate=0,state=10
:state=12,varequal=2TrtSys 0,varequal=LS 1:state=16
;if turrets 1 & 3 are alive
:state=13,varequal=2TrtSys 1:settargetname=hllwypt3,activatetarget=2,state=14
:state=13,varequal=2TrtSys 0,varequal=LS 1:state=16
:state=14,varequal=2TrtSys 1,activated=6:settargetname=hllwypt1,activatetarget=2,activate=0,state=15
:state=14,varequal=2TrtSys 0,varequal=LS 1:state=16
:state=15,varequal=2TrtSys 1,activated=2:activate=0,state=13
:state=15,varequal=2TrtSys 0,varequal=LS 1:state=16
;end of subscript
;for a LastStand mode(subscript)
:state=16,varequal=2TrtSys 0,varequal=LS 1,varequal=TrtAlive1 1:state=17
:state=16,varequal=2TrtSys 0,varequal=LS 1,varequal=TrtAlive2 1:state=
:state=16,varequal=2TrtSys 0,varequal=LS 1,varequal=TrtAlive3 1:state=
;if turret 1 is alive
:state=17,varequal=LS 1:settargetname=hllwypt1,activatetarget=3,suspend
:state=17,varequal=LS 0:suspend
;if turret 2 is alive
:state=18,varequal=LS 1:settargetname=hllwypt2,activatetarget=3,suspend
:state=18,varequal=LS 0:suspend
;if turret 3 is alive
:state=19,varequal=LS 1:settargetname=hllwypt3,activatetarget=3,suspend
:state=19,varequal=LS 0:suspend
;end of subscript
:always:setcursor=10 10,printval=%TrtAlive1
:always:setcursor=10 20,printval=%TrtAlive2
:always:setcursor=10 30,printval=%TrtAlive3
:always:setcursor=10 40,printval=%LS
:always:setcursor=10 50,printval=%3TrtSys
;End of Script
and the turrets;
#1:
;Dar13's Turret Artificial Intelligence Script
;Header
desc = hallway turret #1
;Triggers
;initialization and sending the script to an appropriate sub-script
:state=0,activated=0:reloadweapon
:state=0,activated=1:state=1
:state=0,activated=2:state=5
:state=0,activated=3:state=10
;sub-script1:all turrets alive and you're selected to fire
:state=1:animate=1,state=2
:state=2,animationover=1:useweapon,etimerstart,state=3
:state=3,etimergreater=100:animate=2,state=4
:state=4,animationover=2:settargetname=hllwytrrtcmd,activatetarget=1,activate=0,state=0
;sub-script2:two turrets alive and you're selected to fire
:state=5:animate=1,state=6
:state=6,frameatend=1:useweapon,etimerstart,state=7
:state=7,etimergreater=15000:animate=2,state=8
:state=8,frameatend=2:settargetname=hllwytrrtcmd,activatetarget=2,activate=0,state=0
;sub-script3:only turret alive
:state=10:animate=1,state=11
:state=11,frameatend=1:useweapon,state=12
:state=12,ifweapon=0:animate=2,state=13
:state=13,frameatend=2:reloadweapon,state=14
:state=14:state=10
:varless=$EH 1:settargetname=hllwytrrtcmd,activatetarget=7
;End of Script
#2:
;Dar13's Turret Artificial Intelligence Script
;Header
desc = hallway turret #3
;Triggers
;initialization and sending the script to an appropriate sub-script
:state=0,activated=0:reloadweapon
:state=0,activated=1:state=1
:state=0,activated=2:state=5
:state=0,activated=3:state=10
;sub-script1:all turrets alive and you're selected to fire
:state=1:animate=1,state=2
:state=2,animationover=1:useweapon,etimerstart,state=3
:state=3,etimergreater=1000:animate=2,state=4
:state=4,animationover=2:settargetname=hllwytrrtcmd,activatetarget=5,activate=0,state=0
;sub-script2:two turrets alive and you're selected to fire
:state=5:animate=1,state=6
:state=6,animationover=1:useweapon,etimerstart,state=7
:state=7,etimergreater=15000:animate=2,state=8
:state=8,animationover=2:settargetname=hllwytrrtcmd,activatetarget=6,activate=0,state=0
;sub-script3:only turret alive
:state=10:animate=1,state=11
:state=11,animationover=1:useweapon,state=12
:state=12,ifweapon=0:animate=2,state=13
:state=13,animationover=2:reloadweapon,state=14
:state=14:state=10
:varless=$EH 1:settargetname=hllwytrrtcmd,activatetarget=9
;End of Script
#3:
;Dar13's Turret Artificial Intelligence Script
;Header
desc = hallway turret #2
;Triggers
;initialization and sending the script to an appropriate sub-script
:state=0,activated=0:reloadweapon
:state=0,activated=1:state=1
:state=0,activated=2:state=5
:state=0,activated=3:state=10
;sub-script1:all turrets alive and you're selected to fire
:state=1:animate=1,state=2
:state=2,animationover=1:useweapon,etimerstart,state=3
:state=3,etimergreater=1000:animate=2,state=4
:state=4,animationover=2:settargetname=hllwytrrtcmd,activatetarget=3,activate=0,state=0
;sub-script2:two turrets alive and you're selected to fire
:state=5:animate=1,state=6
:state=6,animationover=1:useweapon,etimerstart,state=7
:state=7,etimergreater=15000:animate=2,state=8
:state=8,animationover=2:settargetname=hllwytrrtcmd,activatetarget=4,activate=0,state=0
;sub-script3:only turret alive
:state=10:animate=1,state=11
:state=11,animationover=1:useweapon,state=12
:state=12,ifweapon=0:animate=2,state=13
:state=13,animationover=2:reloadweapon,state=14
:state=14:state=10
:varless=$EH 1:settargetname=hllwytrrtcmd,activatetarget=8
;End of Script
Btw, this uses Ply's Mod V108.
Any help is appreciated greatly.
...