Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Gametee


Post Reply 
 
Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Making chests fly open with touched.
Author Message
Homicide13 Offline
Senior Member

Posts: 323
Joined: Nov 2010
Reputation: 14
Post: #1
Making chests fly open with touched.

So I know the callback function
SetEntityPlayerInteractCallback("chest_small_6","Chest1",true);
would be used, and the function that it would call to would look something like
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?)

11-10-2010 01:39 AM
Find all posts by this user Quote this message in a reply
jens Offline
Frictional Games

Posts: 4,095
Joined: Apr 2006
Reputation: 202
Post: #2
RE: Making chests fly open with touched.

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.
11-10-2010 06:55 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)