I was curious what would it be like to make the sliding doors in Arma 3 hospital building to open and close automatically. After a few lines of really bad code it actually didn’t look too bad:
But then you guys who watched the video started asking for this bad code, so I’ve decided to do a proper job this time. The function I’ve constructed will first assemble the hospital building from 3 available hospital parts. You only need to supply function with direction you want the hospital facing and position. Then the function will add 3 triggers, one for each sliding door (can’t seem to stop using triggers now).
The triggers should react to anyone (even zombies) and open doors. I’ve specifically constructed this function to be run on a dedicated server. The reason for this is that only server will operate the doors to avoid potential client code clashes when several people are in proximity. Also the building should be built only once, and this is again could be easily done if function is executed on dedicated server. You can however just paste the code in Arma 3 debug console in editor to test it, it will also work. Mind you, you will need a very large flat surface. And here is the code: