Beginning Scripting, Requesting a [More thorough] Tutorial - 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: Beginning Scripting, Requesting a [More thorough] Tutorial (/thread-4644.html) |
Beginning Scripting, Requesting a [More thorough] Tutorial - ErichK - 09-21-2010 Hi there! Long time fan, first time poster. Anyway, I've been searching around and trying countless different things, but I have finally given up and resorted to posting on here. I was trying to refer to this thread: http://www.frictionalgames.com/forum/thread-4425.html In order to make a "scary door." However, I have a few issues that the HPL2 tutorial didn't seem to want to go over. Firstoff, here is my .hps file: Code: //The Waking Up Feature that starts as soon as map loads. Everything on there works perfectly, but when I try to add the "scary door" code from the above link, all hell breaks loose. I was wondering if anyone could please help me with the following issues: 1. Could you please provide a completed example of how the code would look in finished form, i.e. adding it to what code I posted here? 2. Elaborate on what needs to go where (in terms of in the script itself - for example, in: Code: SetEntityPlayerInteractCallback("name_of_door_here", "FunctionToCall", true); Does "FunctionToCall" mean "insert text here," and if so, are these the functions?: Code: void FunctionToCall(string &in entity) 3. And lastly, what snippets of code do I put in the entity tab of the door, under the Callback function boxes? Thanks for any help. I've been trying to pull up the developer code as well as examples from other custom stories, but I'm still too new at it to be able to figure it out on my own. I'm sure, however, that if I get an example of a finished (or close to finished) product, I can get the rest on my own. Thanks! -Erich RE: Beginning Scripting, Requesting a [More thorough] Tutorial - MulleDK19 - 09-21-2010 The code below assumes that your door is called "mansion_1" (without the quotes), and your monster is called "servant_brute_1" (without the quotes). Code: //The Waking Up Feature that starts as soon as map loads. RE: Beginning Scripting, Requesting a [More thorough] Tutorial - ErichK - 09-22-2010 Thanks! This helps a lot! But what snippet of code do I put in the callback function box for the entity in the editor? This one? : Code: void InteractedWithDoor(string &in entity) RE: Beginning Scripting, Requesting a [More thorough] Tutorial - jens - 09-22-2010 None, this script is written so it does not use the level editor. void InteractedWithDoor(string &in entity) is triggered by the line SetEntityPlayerInteractCallback("mansion_1", "InteractedWithDoor", true); but You can remove the line SetEntityPlayerInteractCallback("mansion_1", "InteractedWithDoor", true); and then select the mansion_1 door in the editor, go to the entity tab, and there is an input named SetInteractCallback (or something like that) in which you would enter InteractedWithDoor to accomplish the same thing as the script line you removed. |