Ok, some interesting things have happened.
This script
+ Code Snippet
;Artificial Intelligence Script
;Header
desc = Remote Controlled Door (Open initially and Closed by trigger)
;Triggers
:state=0,activated=0:state=1,setframe=0,sound=$0
:state=1:incframe=0
:state=1,frameatend=0:state=2,coloff
:state=2,activated=1:state=3,sound=$1,colon
:state=3:decframe=0
:state=3,frameatstart=0:setframe=0,state=0
;End of Script
With this on the switch:
;Artificial Intelligence Script
;Header
desc = Use Switch (animated lever)
;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=10,plrdistwithin=100,plrusingaction=1:state=1,setframe=0,plrsound=$0,activateifused=0
:state=1:incframe=0
:state=1,frameatend=0:state=2
:state=2,plrusingaction=0:state=3
:state=3,plrdistwithin=100,plrusingaction=1:state=4,plrsound=$1,activateifused=0
:state=4:decframe=0
:state=4,frameatstart=0:state=5,setframe=0
:state=5,plrusingaction=0:state=10
;End of Script
Now works the door properly. BUT now the sound that the entity activates does not stop when I hit the switch. I have to hit it and then hit it again into the "off" position (the starting position) to stop the music. What can I do to remedy this?
This is the sound script.
;Artificial Intelligence Script
;Header
desc = Loop sound then hit switch
;Triggers
:state=0:loopsound=audiobank/user/final.wav,state=1
:state=1,activated=1:Destroy
I've tried changed "Activated=1" to "0" but as expected the sound does not play.