Frictional Games Forum (read-only)
[SCRIPT] [SOLVED] Levers - 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 - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: [SCRIPT] [SOLVED] Levers (/thread-26898.html)

Pages: 1 2


RE: Levers - Straxedix - 10-19-2014

(10-18-2014, 11:41 AM)Lazzer Wrote:
PHP Code:
void Func(string &in asEntityint alState
{
if(
alState == 1)
{
//If ON
}

if(
alState == -1)
{
//If OFF


Those two little bastards allow you to do what happens whether you pull them up or down, I beleive 1 is if you pull lever up, so basically put the stuff you want to happen in the state 1, if neither that helps try putting the stuff to -1 instead of 1.

+rep

(10-18-2014, 07:20 AM)FlawlessHappiness Wrote: Levers work, with the thing called "alState".

This is the callback for a lever, placed in void OnStart() (For beginners)

PHP Code:
SetEntityConnectionStateChangeCallback(stringasNamestringasCallback); 

The function will look like this:

PHP Code:
void Func(string &in asEntityint alState
{
if(
alState == 1)
{
//If ON
}

if(
alState == -1)
{
//If OFF
}


Simply put in SetLampLit when ON and OFF, and put in false and true, for whatever your liking ^^

+rep