Frictional Games Forum (read-only)
Make a lever move an object - 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: Make a lever move an object (/thread-5313.html)



Make a lever move an object - jockelix - 11-04-2010

I was wondering if you could make a lever move for example a bookshelf or other entity? I´ve looked around but cant rly find an answer so does anyone have a script for this or could someone atleast point me in the right direction?


RE: Make a lever move an object - anzki - 11-04-2010

If player is not there when the object should move, you could just add fitting sound effect and activate entity and deactivate other.
Code:
SetEntityActive(string& asName, bool abActive);



RE: Make a lever move an object - jockelix - 11-04-2010

(11-04-2010, 03:16 PM)anzki Wrote: If player is not there when the object should move, you could just add fitting sound effect and activate entity and deactivate other.
Code:
SetEntityActive(string& asName, bool abActive);

That sounds smart but since i am a total noob at scripting could you show me how that script would look?


RE: Make a lever move an object - anzki - 11-05-2010

Code:
void WhateverFunctionYouUseWithTheLever(WhatEverBelongsHere)
{
SetEntityActive("EntityName1", false);
SetEntityActive("EntityName2", true);
}
-EntityName1 is the name of the entity that is active from the start, and is going to dissapear.
-EntityName2 is name of the entity that is inactive from the star, and is going to be activated.
-You can set entity inactive by checking "Inactive" checkbox in level editor.