ok i have 2 working scripts that call the lift when its not at your level. one is for lift starting down (lift1a.fpi) and the other is for lift starting up (lift2a.fpi)
they work with my modified switch script switch1a.fpi and a lift switch.
here is the first one for lifts that start GOING UP:
;Artificial Intelligence Script
;Header
desc = Auto Lift (Up and Down, going UP at startup) (switch activation brings lift to player)
;Triggers
:state=0,plrhigher=10,plrdistwithin=50:state=6,coloff
:state=1:moveup=1
:state=1,raycastup=20 100:state=2
:state=2,plrdistfurther=55,playerassociated:state=3,unassociateplayer,colon
:state=3,plrhigher=10,plrdistwithin=50:state=7,coloff
:state=4:moveup=-1
:state=4,raycastup=20 0:state=5
:state=5,plrdistfurther=55,playerassociated:state=0,unassociateplayer,colon
:state=6,plrdistwithin=50:sound=audiobank\scifi\scenery\lifts\up.wav,state=1,associateplayer
:state=6,plrdistfurther=55,playerassociated:state=0,unassociateplayer,colon
:state=7,plrdistwithin=50:sound=audiobank\scifi\scenery\lifts\down.wav,state=4,associateplayer
:state=7,plrdistfurther=55,playerassociated:state=3,unassociateplayer,colon
:activated=1:state=11,activate=0,coloff
:state=11,plrhigher=100:state=21,sound=audiobank\scifi\scenery\lifts\up.wav
:state=11,plrdistfurther=150:state=31,sound=audiobank\scifi\scenery\lifts\down.wav
:state=11,plrdistwithin=150,raycastup=20 0:state=0,colon,sound=audiobank\switches\ironlever.wav
:state=11,plrdistwithin=150,raycastup=20 100:state=3,colon,sound=audiobank\switches\ironlever.wav
:state=41:coloff,state=42
:state=42:colon,state=3
:state=51:coloff,state=52
:state=52:colon,state=0
:state=21,raycastup=20 100:state=41,colon
:state=21:moveup=1
:state=31,raycastup=20 0:state=51,colon
:state=31:moveup=-1
;End of Script
here is the second one for lifts that start GOING DOWN:
;Artificial Intelligence Script
;Header
desc = Auto Lift (Down and Up, going DOWN at startup) (switch activation brings lift to player)
;Triggers
:state=0:state=3
:state=3,plrhigher=10,plrdistwithin=50:state=7,coloff
:state=4:moveup=-1
:state=4,raycastup=20 0:state=5
:state=5,plrdistfurther=55,playerassociated:state=10,unassociateplayer,colon
:state=10,plrhigher=10,plrdistwithin=50:state=6,coloff
:state=11:moveup=1
:state=11,raycastup=20 100:state=12
:state=12,plrdistfurther=55,playerassociated:state=3,unassociateplayer,colon
:state=6,plrdistwithin=50:sound=audiobank\scifi\scenery\lifts\up.wav,state=11,associateplayer
:state=6,plrdistfurther=55,playerassociated:state=10,unassociateplayer,colon
:state=7,plrdistwithin=50:sound=audiobank\scifi\scenery\lifts\down.wav,state=4,associateplayer
:state=7,plrdistfurther=55,playerassociated:state=3,unassociateplayer,colon
:activated=1:state=15,activate=0,coloff
:state=15,plrhigher=100:state=21,sound=audiobank\scifi\scenery\lifts\up.wav
:state=15,plrdistfurther=150:state=31,sound=audiobank\scifi\scenery\lifts\down.wav
:state=15,plrdistwithin=150,raycastup=20 0:state=10,colon,sound=audiobank\switches\ironlever.wav
:state=15,plrdistwithin=150,raycastup=20 100:state=3,colon,sound=audiobank\switches\ironlever.wav
:state=41:coloff,state=42
:state=42:colon,state=3
:state=51:coloff,state=52
:state=52:colon,state=10
:state=21,raycastup=20 100:state=41,colon
:state=21:moveup=1
:state=31,raycastup=20 0:state=51,colon
:state=31:moveup=-1
;End of Script
here is the switch script. its important to use this one as it only sends activateifused=1 ONCE to the lift:
;Artificial Intelligence Script
;Header
desc = Instance Switch (activate upon use)
;Triggers
:state=0:hudreset,hudx=50,hudy=90,hudimagefine=gamecore\text\pressentertouse.tga,hudname=useswitchprompt,hudhide=1,hudmake=display,state=10
:plrdistwithin=100:hudshow=useswitchprompt,hudfadeout=useswitchprompt
:state=1:incframe=0,activateifused=0
:state=1,frameatend=0:state=2
:state=2,plrusingaction=0:state=4
:state=4:decframe=0
:state=4,frameatstart=0:state=5,setframe=0
:state=5:state=10
:state=10,plrdistwithin=100,plrusingaction=1:state=1,setframe=0,plrsound=$0,activateifused=1
;End of Script
i will post again with some notes on how they work. same thread.