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

Privacy Policy


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Colliding two entities
Author Message
Your Computer Offline
SCAN ME!

Posts: 3,231
Joined: Jul 2011
Reputation: 215
Post: #1
Question Colliding two entities
So i am trying to make it so when the user tosses a chair at the door, the door opens. However, whenever i try to add an entity collide callback, the game crashes at that point. The following statement is the culprit:
AddEntityCollideCallback("front_door", "armchair_1", "EntityCollided", true, 0);

Is the game not designed to handle entity-to-entity collision? Or am i supposed to use a different function? Or is the only way to accomplish my goal is through the use of areas? Or...?

Huh
07-27-2011 01:41 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Kyle Offline
Posting Freak

Posts: 910
Joined: Sep 2010
Reputation: 7
Post: #2
RE: Colliding two entities
It should work, but you should try to swap the string &in asParent and the string &in asChild and also have the collision type to be 1. If it doesn't work, then put a script area on the door to where "armchair_1" collides with the script area causing "armchair_1" to hit the door indefinately.

AddEntityCollideCallback("armchair_1", "front_door", "EntityCollided", true, 1);

OR

AddEntityCollideCallback("armchair_1", "ScriptArea_1", "EntityCollided", true, 1);

07-27-2011 01:46 PM
Find all posts by this user Quote this message in a reply
Your Computer Offline
SCAN ME!

Posts: 3,231
Joined: Jul 2011
Reputation: 215
Post: #3
RE: Colliding two entities
Hmm, switching the parent with child prevents the game from crashing, but the collision isn't being triggered. Changing alStates doesn't help either. Seems i might have to go with an area...
07-27-2011 02:17 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Apjjm Offline
Super Moderator

Posts: 444
Joined: Apr 2011
Reputation: 42
Post: #4
RE: Colliding two entities
(07-27-2011 02:17 PM)Your Computer Wrote:  Hmm, switching the parent with child prevents the game from crashing, but the collision isn't being triggered. Changing alStates doesn't help either. Seems i might have to go with an area...

You probably will have to use an area, trying to collide two solid bodies is unreliable.

07-27-2011 02:35 PM
Find all posts by this user Quote this message in a reply
Post Reply 




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