Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
(Script)Lever Opens a Door
Theforgot3n1 Offline
Member

Posts: 192
Threads: 20
Joined: Apr 2012
Reputation: 6
#10
RE: (Script)Lever Opens a Door

Ehm, so you want a button that closes and locks the door at the same time when pushed?

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);

}

That should be all. I'm slightly unsure if the SetMoveObjectStateExt works exactly like they should. But yeah, you can always check the Engine Scripts in the wiki.
Good luck!

Confusion: a Custom Story - Ch1 for play!
http://www.frictionalgames.com/forum/thread-15477.html
About 50% built.
Delayed for now though!
06-13-2012, 12:56 PM
Website Find


Messages In This Thread
(Script)Lever Opens a Door - by No Author - 06-12-2012, 08:46 AM
RE: (Script)Lever Opens a Door - by Putkimato - 06-12-2012, 12:12 PM
RE: (Script)Lever Opens a Door - by No Author - 06-12-2012, 12:54 PM
RE: (Script)Lever Opens a Door - by Putkimato - 06-12-2012, 03:23 PM
RE: (Script)Lever Opens a Door - by No Author - 06-13-2012, 06:40 AM
RE: (Script)Lever Opens a Door - by Putkimato - 06-13-2012, 09:48 AM
RE: (Script)Lever Opens a Door - by No Author - 06-13-2012, 09:57 AM
RE: (Script)Lever Opens a Door - by No Author - 06-13-2012, 10:27 AM
RE: (Script)Lever Opens a Door - by Theforgot3n1 - 06-13-2012, 12:56 PM
RE: (Script)Lever Opens a Door - by No Author - 06-14-2012, 08:31 AM
RE: (Script)Lever Opens a Door - by Dutton - 06-14-2012, 09:30 AM
RE: (Script)Lever Opens a Door - by No Author - 06-14-2012, 10:02 AM
RE: (Script)Lever Opens a Door - by No Author - 06-15-2012, 07:21 AM



Users browsing this thread: 1 Guest(s)