Frictional Games Forum (read-only)

Full Version: Make Cabinet Open By It Self
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey I was wondering if it was possible to open one of the two cabinet doors by it self?
I have tried:
With rotateArea:
///////////////////////////////////////////////////////////////////////////////////////////////
void CabinetScare(string &in asParent, string &in asChild, int alState)
{
AddTimer("", 2, "StopSound");
AddTimer("Cabinet", 0, "RotateArea")
PlaySoundAtEntity("creak", "joint_door_move_special.snt", "Cabinet", 1, false);
}

void RotateArea(string %in asTimer
{
if (GetLocalVarInt ("Check") == 0)
{
if (alState == 1)
{
SetMoveObjectState("Cabinet", 1);

SetLocalVarInt("Check", 1);

return;
}
}
)

void StopSound(string &in asTimer)
{
StopSound("creak", 0.4);
}
////////////////////////////////////////////////////////////////////////////////////////////

And I was thinking to try "prop Force" to but just wanted to hear if it was possible[/size][/font]
It's definitely possible - I believe there is a wiki entry about it... Give me a moment and I will dig it up!

Yep - here: https://wiki.frictionalgames.com/hpl2/tu...hdoorsopen

Check out the "entities with doors" section Smile
(02-26-2016, 10:52 AM)Romulator Wrote: [ -> ]It's definitely possible - I believe there is a wiki entry about it... Give me a moment and I will dig it up!

Thx Man Smile
I also have this lengthy video on such a topic should you find it helpful. Just remember to use the "Body" script instead of the "Prop" script, and include the body name after the entity name. Otherwise, it should be same.