Frictional Games Forum (read-only)
need some help with levers and a secret door. - 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: need some help with levers and a secret door. (/thread-9048.html)



need some help with levers and a secret door. - NorK - 07-09-2011

hey

am trying to make a secret door to open when pulling a lever.
the secret door in the start of the game, after u find ur first note from self.

can any1 tell me how it works.

void SetEntityConnectionStateChangeCallback(string& asName, string& asCallback);
A callback called when ever the connection state changes (button being switched on, lever switched, etc).
Callback syntax: void Func(string &in EntityName, int alState)
alState: -1 = off, 0 = between, 1 = on

have looked on this but cant figure out where to put the alstate....



RE: need some help with levers and a secret door. - Kyle - 07-09-2011

You can try this:

Code:
void OnStart()
{
     SetEntityConnectionStateChangeCallback("Lever_1", "Func01");
}
void Func01(string &in asName, int alState)
{
     if (alState == 1)
     {
          //Secret door is opened when said so here
     }
}