Looking at the code further (thank you so much by the way):
I see that active_tri has three states: 0, 1, 2, 3. However, my switch only has three positions (middle, up, down). My plan is that each of those three states will lead to a different position for doors/platforms. Do I really need the 4th state then?