Frictional Games Forum (read-only)
Lever Help - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods (https://www.frictionalgames.com/forum/forum-35.html)
+--- Thread: Lever Help (/thread-5465.html)



Lever Help - house - 11-16-2010

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.


RE: Lever Help - Hooumeri - 11-16-2010

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



RE: Lever Help - house - 11-16-2010

What you wrote is a little too complitcated to understand a little.


RE: Lever Help - Chilton - 11-17-2010

Well, theres no simple function. Use it or lose it Smile
How else will you learn


RE: Lever Help - house - 11-17-2010

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