Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pull lever Combination lock [Help Needed]
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#6
RE: Pull lever Combination lock [Help Needed]

I must say thanks. Okay, "SetLocalVarInt("Lev", 1);" sets a local integer named "Lev" that's used as a variable representing 1 as the amount of the variable at the time before it's changed(in the scope(usable in the whole script) of the script). The "SetEntityConnectionStateChangeCallback" is used when a lever, in this case "lever_1", changes state, 1 for down, 0 for middle, -1 for top. So if the lever is pulled up, nothing will happen, but if it's pulled down, then stuff does happens. In the function "L1", it checks to see if the "alState", or which way it's being pulled, and also checks if the local integer variable equals what it asks. So if the local integer variable currently equals 1, and you pull lever_1 down, then the "else if (GetLocalVarInt("Lev") != 3)" checks to see if the local integer variable does NOT equal 3. Since it equals 1, it sets all the levers active again so they can be pulled again in the correct order. So if the player pulls down the correct lever, it sets the local integer variable to the next number so they can pull the next lever. And it also sets the lever to not be able to be interacted with which could cause the player to screw up the combination by accidently pulling it twice, having to restart the combination. Big Grin

Alright, got to go, bye.

Also I don't really know how to make the shelves move on it's axis because I never tried. No time, got to go. :/

(This post was last modified: 05-02-2011, 12:13 PM by Kyle.)
05-02-2011, 12:11 PM
Find


Messages In This Thread
RE: Pull lever Combination lock [Help Needed] - by Kyle - 05-02-2011, 12:11 PM



Users browsing this thread: 1 Guest(s)