I have thought of some special behaviours for doors to work, and I thought I might share my ideas. (All have mostly the same code.)
1) This first script, will make only doors accessible by enemies, if they have in their code
settarget,activatetarget=2 (but you still can change activations values
)
;Artificial Intelligence Script
;Header
desc = (Enemy-only) Open, auto-close
;Triggers
:state=0,activated=2:state=1,setframe=0,sound=$0,coloff
:state=1:incframe=0
:state=1,frameatend=0:state=2,timerstart
:state=2,plrdistwithin=50,plrusingaction=1:activate=0
:state=2,plrdistfurther=50,timergreater=3000:activate=0
:state=2,activated=0:state=3,sound=$1,colon
:state=3:decframe=0
:state=3,frameatstart=0:state=0,setframe=0
;End of Script
2) This one just is a normal door, exept it closes by itself. Note that every other doors I made do that, but this one is the main idea.
;Artificial Intelligence Script
;Header
desc = Open, auto-close
;Triggers
:state=0,plrdistwithin=50,plrusingaction=1:activate=2
:state=0,activated=2:state=1,setframe=0,sound=$0,coloff
:state=1:incframe=0
:state=1,frameatend=0:state=2,timerstart
:state=2,plrdistwithin=50,plrusingaction=1:activate=0
:state=2,plrdistfurther=50,timergreater=3000:activate=0
:state=2,activated=0:state=3,sound=$1,colon
:state=3:decframe=0
:state=3,frameatstart=0:state=0,setframe=0
;End of Script
3) Now this one was made possible thanks to Merranvo; it's a door that will only open from one side. It's a complex door, and need the use of a second entity to work. (I use triggerzone). Now what you do is apply this code to your door,
;Artificial Intelligence Script
;Header
desc = Open, auto-close, one-way (FOR PLAYER ONLY)
;Triggers
:state=0:activateifused=1,state=1
:state=1,activated=1:state=2,setframe=0,sound=$0,coloff
:state=2:incframe=0
:state=2,frameatend=0:state=3,timerstart
:state=3,plrdistwithin=50,plrusingaction=1:activate=0
:state=3,plrdistfurther=50,timergreater=3000:activate=0
:state=3,activated=0:state=4,sound=$1,colon
:state=4:decframe=0
:state=4,frameatstart=0:state=1,setframe=0,activateifused=1
;End of Script
then, you apply this next code to your second entity, that you will put on the side of the door you wish to be accessible:
;Artificial Intelligence Script
;Header
desc = Door Zone, for one-way doors (FOR PLAYER ONLY)
;Triggers
:plrwithinzone=1,plrusingaction=1,activated=1:activateifused=1
Now, at this point it'll never work. You'll have to put in the door's property
ifused, the name of your second entity, or zone. Then, for your second entity or zone, you'll put in the
ifused field the name of your door. Note that you should use unique names! The main idea is that both entities are linked together.
But it appears it wouldn't work with enemies, because they activate everything in their way to move, so the activations would get mixed up.
I know that some script might turn wierd with some enemies playing to much around doors, but I gess it's a good start for somebody that is using FPSC for 10 days
!
Hope this help some creators