Frictional Games Forum (read-only)
hw to make a lever functional? - 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: hw to make a lever functional? (/thread-6905.html)



hw to make a lever functional? - cheeseburgerXD - 03-16-2011

i saw the lever script in the script recollections and i follow it but it wont workAngryAngry this may be a noob question but can someone help me out


RE: hw to make a lever functional? - house - 03-16-2011

Two of this forum?

I never knew how to make a lever, I made a thread, but no good anwsers.


RE: hw to make a lever functional? - Viperdream - 03-16-2011

Code:
// Callback function for when the lever's state changes
// EntityName is the name of the lever
// alState is the current state of the lever, -1 being low, 0 middle and 1 high *
void OnLeverStateChange(string &in EntityName, int alState)
{
    // Do something when the state changes
        // Optional debug message
    AddDebugMessage(EntityName + "'s current state: " + alState, false);

    if (alState == -1)
    {
        // Do something if the lever's state is low (or change it to 0 or 1)
    }
}
// * low, middle and high are relative to its rotation.

Got it from the script recollection's thread. It's in the stickies. It's not that hard to find :<


RE: hw to make a lever functional? - Hooumeri - 03-16-2011

(03-16-2011, 01:36 PM)Viperdream Wrote:
Code:
// Callback function for when the lever's state changes
// EntityName is the name of the lever
// alState is the current state of the lever, -1 being low, 0 middle and 1 high *
void OnLeverStateChange(string &in EntityName, int alState)
{
    // Do something when the state changes
        // Optional debug message
    AddDebugMessage(EntityName + "'s current state: " + alState, false);

    if (alState == -1)
    {
        // Do something if the lever's state is low (or change it to 0 or 1)
    }
}
// * low, middle and high are relative to its rotation.

Got it from the script recollection's thread. It's in the stickies. It's not that hard to find :<

He said he found it, just couldnt get it to work.

OP, you should post your script so we can see what's wrong.


RE: hw to make a lever functional? - Tottel - 03-16-2011

If he wants help, then he can at least post some more details.