Frictional Games Forum (read-only)

Full Version: Lever Help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Can someone tell me how to make a lever stuck and when you pick up the lantern, its not stuck? One more thing, when you pull down the lever, can someone tell me how to make it so it unlocks a door? I'm making a custom story called Bio Lab. This is what I need for the story.
(11-16-2010, 06:52 PM)house Wrote: [ -> ]Can someone tell me how to make a lever stuck and when you pick up the lantern, its not stuck? One more thing, when you pull down the lever, can someone tell me how to make it so it unlocks a door? I'm making a custom story called Bio Lab. This is what I need for the story.

I'm not an expert on how to make levers work, but I would make two seperate levers. One of them does nothing, but as soon as you touch the lantern - the one that works will appear.

Code:
void OnStart()
{
AddEntityCollideCallback("Player", "lantern_01", "CollideLanternTouch_01", true, 1);

SetEntityConnectionStateChangeCallback("lever_nice01_1", "StateChangeLever");
}

void CollideLanternTouch_01(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("lever_nice01", false);
SetEntityActive("lever_nice01_1", false);
}

void StateChangeLever(string &in asEntity, int alState)
{
if(alState == 1){
SetLeverStuckState(asEntity, 1, true);
SetSwingDoorLocked("prison_1", false, true);
PlaySoundAtEntity("", "unlock_door", "Player", 0.0, false);
}
}
What you wrote is a little too complitcated to understand a little.
Well, theres no simple function. Use it or lose it Smile
How else will you learn
(11-17-2010, 03:39 AM)Chilton Wrote: [ -> ]Well, theres no simple function. Use it or lose it Smile
How else will you learn

He said he really didn't know how to use levers for scripting. ( Atleast I think. )