Frictional Games Forum (read-only)

Full Version: Door open script
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

Quick question, which script function do i have to use when I want to open a door when walking trough a script area?

Don't uderstand me wrong I know how to make Callbacks for the script area, I only want to know the script function for the door... Blush


Greets

iFondue
The two functions you need are:

SetSwingDoorDisableAutoClose(string& asName, bool abDisableAutoClose);


disables the auto close of a door

and

AddPropForce(string& asName, float afX, float afY, float afZ, string& asCoordSystem);


Adds force to a prop. (be sure to use "world" as the Coordinate System)

Hope that helped.
The script would be like this:

void OnStart()
{
AddEntityCollideCallback("Player", "name of script area", "Open wished door", true, 1);
}

void Open wished door(string &in asParent, string &in asEntity, int alState)
{
AddPropForce("Name of door", 0, 0, 0, "world");
}
void OnEnter ()
{

}

void OnLeave()

{

}

I don't know what coordinates you should put, but you can test it.
It should be something like this. Hope it helped.