Frictional Games Forum (read-only)

Full Version: Quick Question on Levers
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am trying to figure out how to make levers only have 2 positions, like a common light switch. Where it can only be on or off, no middle. I need my switch to start out in the off position, and when someone pushes it to the ON position, it stays. I know I can just use a stuck state for that. But how do I get it to start out in the OFF position and not in the default MIDDLE position?
Try setting it to a stuck position in the down position, and then when the player interacts with it, it loses it's stick and so they can move it to the up position. Then, you call a script that when alState == -1, stick the lever in that position, and the same for == 1. (double equals for equality in script)
Is there a function for setting it's stuck state? I used that technique before, but the user has to click on the lever, then click again to move it. And of course, when you click it the first time, it autofloats to the middle. This adds extra work to something the player needs to do under pressure (waterlurker is-a-comin').

I thought it would be some concoction of using MiddleAngleAmount and AutoMoveGoal. I tried using those to no avail. Like it should automove to the bottom, and its stuck state is at the top.
The "limpness" of Amnesia's switches has bothered me as well. I'm about to wrestle with the issue this week.
Did you know the piano and openable chests are levers?
Oh wow, I just checked. That's actually pretty cool.

Pfft. How silly. It turns out, I needed to check (under the switch's properties) Override Defaults. Once you have this checked, you can go all willy-nilly with the settings below it. Tongue