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