Frictional Games Forum (read-only)
Making chests fly open with touched. - 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 (https://www.frictionalgames.com/forum/forum-35.html)
+--- Thread: Making chests fly open with touched. (/thread-5394.html)



Making chests fly open with touched. - Homicide13 - 11-10-2010

So I know the callback function
Code:
SetEntityPlayerInteractCallback("chest_small_6","Chest1",true);
would be used, and the function that it would call to would look something like
Code:
void Chest1(string &in entity)
{
    AddPropImpulse("chest_small_6",0,25,0,"");
}
but the problem with this is that when a player opens the chest, he is grabbing onto it and so no matter how large the impulse the lid will be held in place by the player (well it will fly open and then fly back to a semi-closed state, or wherever the player's cursor is). Is there any way to get around this? (such as a way to make the player let go of the chest before it is sent flying open?)


RE: Making chests fly open with touched. - jens - 11-10-2010

I think you can use SetEntityInteractionDisabled("chest_small_6", true); to disable the interaction on the chest just before you give it the impulse, then shortly after you can turn on the interaction again.