Help scripting an event when looking at an area - 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 (https://www.frictionalgames.com/forum/forum-35.html) +--- Thread: Help scripting an event when looking at an area (/thread-6542.html) |
Help scripting an event when looking at an area - Tryed - 02-11-2011 Hello I'm trying to script an event that happens when you LOOK AT an area, but with no success. Actually I have no clue if its possible/how its done I've been trying these lines Code: * Callback syntax: MyFunc(string &in entity, int alState) state: 1=looking, -1=not looking But with no success. I'm completely lost here. Any help would be appreciated RE: Help scripting an event when looking at an area - Akasu - 02-11-2011 Code: void OnStart () That should work. RE: Help scripting an event when looking at an area - Tryed - 02-11-2011 That worked, thanks a lot. But I have another question. How do I trigger an event when holding an object/grabbing a door? I want it to show a message when the player tries to open a locked door. RE: Help scripting an event when looking at an area - Akasu - 02-11-2011 The functions for that are Code: SetEntityPlayerInteractCallback(string& asName, string& asCallback, bool abRemoveOnInteraction) and Code: SetMessage("Crap","Door",-1); Plus, you'll need to make a text file called "extra_english.lang" into your custom story folder and write these lines in it: Code: <LANGUAGE> Also check out this page if you haven't yet. |