Frictional Games Forum (read-only)
Opening Closet/Cabinets? - 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: Opening Closet/Cabinets? (/thread-9387.html)



Opening Closet/Cabinets? - JoeBradleyUK - 07-26-2011

I want to open a cabinet when i walk near it, i know how to script it but i don't know the function, i tried:

SetSwingDoorClosed(string& asName, bool abClosed, bool abEffects);

but that didn't work any ideas?


RE: Opening Closet/Cabinets? - Kyle - 07-26-2011

I don't think that works at all. Try using a "AddPropImpulse(string& asName, float afX, float afY, float afZ, string& asCoordSystem);" function.


RE: Opening Closet/Cabinets? - JoeBradleyUK - 07-26-2011

(07-26-2011, 12:31 PM)Kyle Wrote: I don't think that works at all. Try using a "AddPropImpulse(string& asName, float afX, float afY, float afZ, string& asCoordSystem);" function.

won't that push the cabinet altogether and not the doors Tongue?

Well, i'll test it out anyway


RE: Opening Closet/Cabinets? - Kyle - 07-26-2011

(07-26-2011, 12:35 PM)JoeBradleyUK Wrote:
(07-26-2011, 12:31 PM)Kyle Wrote: I don't think that works at all. Try using a "AddPropImpulse(string& asName, float afX, float afY, float afZ, string& asCoordSystem);" function.

won't that push the cabinet altogether and not the doors Tongue?

The cabinet is in a fixed condition, not the doors. If you have the function set up in the correct x, y, z vector, then it should blast the doors open. It's best to start at a small number like 1 so the doors don't glitch and get stuck and make it look messed up. Tongue


RE: Opening Closet/Cabinets? - JoeBradleyUK - 07-26-2011

(07-26-2011, 12:38 PM)Kyle Wrote:
(07-26-2011, 12:35 PM)JoeBradleyUK Wrote:
(07-26-2011, 12:31 PM)Kyle Wrote: I don't think that works at all. Try using a "AddPropImpulse(string& asName, float afX, float afY, float afZ, string& asCoordSystem);" function.

won't that push the cabinet altogether and not the doors Tongue?

The cabinet is in a fixed condition, not the doors. If you have the function set up in the correct x, y, z vector, then it should blast the doors open. It's best to start at a small number like 1 so the doors don't glitch and get stuck and make it look messed up. Tongue

It's worked thanks!