Frictional Games Forum (read-only)
Head collide - 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: Head collide (/thread-17081.html)



Head collide - tratolak - 07-18-2012

Hi

When i want to make a script which causes when head of the statue(knight) collides with area to do something, how do i do it? I already tried AddEntityCollideCallback("armour_nice_complete_1_Body_1", "ScriptArea_1", "secret", true, 1); but it doesn't do anything... do i have to do something in the Model editor?


RE: Head collide - palistov - 07-18-2012

Try just doing the armor's name. Since the only part of the knight that you can move is the head, it should work. If not you probably have a map_cache issue, or you named something improperly. Go through the usual checks when running into problems like this


1) Check your maps folder, delete .map_cache files (close Amnesia before doing this, then restart)
2) Check naming conventions.
3) Use debug messages liberally, so you know what collisions happen, when they happen, and what objects were involved.


RE: Head collide - tratolak - 07-19-2012

(07-18-2012, 10:18 PM)palistov Wrote: Try just doing the armor's name. Since the only part of the knight that you can move is the head, it should work. If not you probably have a map_cache issue, or you named something improperly. Go through the usual checks when running into problems like this


1) Check your maps folder, delete .map_cache files (close Amnesia before doing this, then restart)
2) Check naming conventions.
3) Use debug messages liberally, so you know what collisions happen, when they happen, and what objects were involved.
I tried to change the name to "armour_Body_1", delete map cache and checked my script for some mistakes. Nothing worked. Then i tried to put "Player" instead of "armour_Body_1" and it worked.

Here is the whole script:

void OnEnter()
{
AddEntityCollideCallback("armour_Body_1", "ScriptArea_1", "secret", true, 1);
}

void secret(string &in asParent, string &in asChild, int alState)
{
SetMessage("Messages", "Scrt", 3);
GiveSanityDamage(20.0f, true);
}


RE: Head collide - tratolak - 07-20-2012

Ok after all i found another sollution how to make this working. I just used Collidecallback, but when the head(the head is counted as statue so i didnt had to put _Body_1) leaves a small area inside the head.