Frictional Games Forum (read-only)
Make Cabinet Open By It Self - 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: Make Cabinet Open By It Self (/thread-40656.html)



Make Cabinet Open By It Self - TheZhadowRider - 02-26-2016

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]


RE: Make Cabinet Open By It Self - Romulator - 02-26-2016

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/tutorials/script/pushdoorsopen

Check out the "entities with doors" section Smile


RE: Make Cabinet Open By It Self - TheZhadowRider - 02-26-2016

(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


RE: Make Cabinet Open By It Self - Mudbill - 02-26-2016

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.