Frictional Games Forum (read-only)
(Script)Lever Opens a 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: (Script)Lever Opens a Door (/thread-16072.html)

Pages: 1 2


RE: (Script)Lever Opens a Door - No Author - 06-14-2012

It doesn't work. I don't get it. Why wouldn't it work ?


RE: (Script)Lever Opens a Door - Dutton - 06-14-2012

(06-14-2012, 08:31 AM)TheNoAuthor12 Wrote: It doesn't work. I don't get it. Why wouldn't it work ?
Post your script, so we might be able to look at what "doesn't work"


RE: (Script)Lever Opens a Door - No Author - 06-14-2012

Here's the script :
void OnStart()







{







SetEntityConnectionStateChangeCallback("lever", "leverfunc");



SetEntityConnectionStateChangeCallback("lever", "leverfunc2");



}







void leverfunc(string &in asEntity, int alState)



{



if (alState == 1)

SetMoveObjectStateExt("wooden_slide_door_1", 1.0f, 1.0f, 5.0f, 5.0f, true);

//All the numbers on the script above depends on what speed you want it
to open. Check out "Engine Scripts" //in the wiki for more information.



}







void leverfunc2(string &in asEntity, int alState)



{



if (alState == -1)



SetMoveObjectStateExt("wooden_slide_door_1", 0.0f, 1.0f, 5.0f, 5.0f, true);



}

What did I do wrong ?


RE: (Script)Lever Opens a Door - No Author - 06-15-2012

Anyone ?