Grabbable feather - 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: Grabbable feather (/thread-14337.html) |
Grabbable feather - Damascus - 03-29-2012 I want to make a monster disappear immediately upon looking away from it, but the only scripts I can find trigger a function when you look AT something instead. Is there a way to do this? Also, I've tried making a pen_feather that you can grab and carry around, but when I pick it up it seems to spin around uncontrollably. What could be causing this? RE: Entity disappearing when you look away + grabbable feather - Your Computer - 03-29-2012 SetEntityPlayerLookAtCallback. RE: Entity disappearing when you look away + grabbable feather - Damascus - 03-29-2012 Calls a function when the player looks at a certain entity. Callback syntax: void MyFunc(string &in asEntity, int alState) alState: 1 = looking, -1 = not looking asName - internal name asCallback - function to call abRemoveWhenLookedAt - determines whether the callback should be removed when the player looked at the entity So in the function called, do I put an "if(alState == -1)" in there? Or is it too late, with the function exectued as soon as you look at it and not able to do anything else? RE: Grabbable feather - Damascus - 03-30-2012 Well I played with it and got it to work this way. Still need some advice on picking up a feather without it spinning like a madman. |