Frictional Games Forum (read-only)
Colliding two entities - 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: Colliding two entities (/thread-9417.html)



Colliding two entities - Your Computer - 07-27-2011

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:
Code:
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


RE: Colliding two entities - Kyle - 07-27-2011

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);


RE: Colliding two entities - Your Computer - 07-27-2011

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...


RE: Colliding two entities - Apjjm - 07-27-2011

(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.