Frictional Games Forum (read-only)

Full Version: Lever that controls door or hatch!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Simple question: how do I script the lever/button etc, to open a door/hatch ??
I'd like to know the same, someone able to assist?
(09-18-2010, 12:18 AM)theDARKW0LF Wrote: [ -> ]I'd like to know the same, someone able to assist?

06_distillery.map has a crank that opens a hatch - I would check that level and see how they did it.
Ok ive found something out by checking scrips from other maps.
I need to name my controller, in this case it's elevator_lever_1. I named it in the ConnectionStateChangeCallback (CSCC) as Lever1 then the script should go something like this:

//Function: ConnectionStateChangeCallback
void Lever1(string &in asEntity, in alState)
{
//If the lever is pulled max up or down then open hatch_metal01_1
if(alState == 1 or alState == -1)
{
//NO idea what to script here.. i know it should be some kind of code "if" lever is in some state it should activate the hatch to open "false or true" depends on the value on the lever.
}
}

one extra question: can I put this script anywhere in my deafault script or does it need a specific place to be? thanks
As for the question over I think it's an interresting topic for noobs like meWink