meapineapple Posted March 2, 2014 I'm tying to get accustomed to ACS. I want to write a script to handle doors in an airlock - a switch would close one door, play a sound, and then open the other door. There is a delay after pressing the switch, and then the door opens. But the other door doesn't close, and no sound plays. What am I doing wrong? Here's a wad with the airlock. #include "zcommon.acs" script 1 (int opensector, int closesector) { int speed = 16; int wait = 100; door_close(closesector,speed); delay(wait/4); AmbientSound("DSBOSPIT",127); delay(wait/4*3); door_raise(opensector,speed,0); } 0 Share this post Link to post
scifista42 Posted March 2, 2014 I think sounds need to be referenced by their respective aliases defined in SNDINFO. For the default SNDINFO, see here: http://zdoom.org/wiki/Predefined_sounds Alias for "DSBOSPIT" is "brain/spit". As for the door not closing, maybe you just call a wrong tag. 0 Share this post Link to post
meapineapple Posted March 2, 2014 Now the sound works, but the doors still don't close. It's definitely not anything wrong with the tags. 0 Share this post Link to post
scifista42 Posted March 2, 2014 "closesector" is the 2nd argument, so make sure you're actually setting the intended tag as 2nd argument, also if there aren't typos in variable name etc., otherwise I really don't know. How do you call the script, anyway, and from where? 0 Share this post Link to post
scifista42 Posted March 2, 2014 I got it. You need to use Door_Open instead of Door_Raise, because Door_Raise with delay=0 keeps the door open forever, overriding the Door_Close function. Also I recommend adding these two lines at the end of your script:tagwait(closesector); tagwait(opensector);That will prevent undesired effects if the player triggers a switch before he should be able to. The switches will be impossible to operate until the doors fully open/close. They you won't even need those barriers in front of switches. 0 Share this post Link to post
meapineapple Posted March 2, 2014 That did it! You are a wonderful person. 0 Share this post Link to post
meapineapple Posted March 3, 2014 Hey, sorry about that. I think it was the problem but my attention got diverted so I didn't look very thoroughly. I'll check now if it's a solution. :) 0 Share this post Link to post