Frictional Games Forum (read-only)

Full Version: Opening Closet/Cabinets?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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?
I don't think that works at all. Try using a "AddPropImpulse(string& asName, float afX, float afY, float afZ, string& asCoordSystem);" function.
(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
(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
(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!