Frictional Games Forum (read-only)

Full Version: Head collide
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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?
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.
(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);
}
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.