(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.
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);
}
}