Scripting, need urgent help! - 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: Scripting, need urgent help! (/thread-9259.html) |
RE: Scripting, need urgent help! - MrCookieh - 07-25-2011 Code: OnStart(){ Explaining time: At first you declare the function to call, when you pickup the note. Then the system checks, if it's on pickup (since it's a note, it's pickup). Then it plays the sounds (already said, it plays the sounds after picking up). After that, the head of the player turns to your entity. You add a timer, which resets the look, so you can move your view again. RE: Scripting, need urgent help! - JetlinerX - 07-25-2011 O_O Oh my god... So if I copy and paste that exact thing... what all should I change? RE: Scripting, need urgent help! - MrCookieh - 07-25-2011 yourbangsound - to your banging sound gaspingsound - gaspingsound string& asEntityName - where you have to look at float afSpeedMul - the speed (smth around 5-6, to have a fast, shocked turn around) float afMaxSpeed - I always keep it at same speed string& asAtTargetCallback - function to call. if no function just do "" Func2 - how you want to name your timer Func2 - the function to call 1 (AddTimer(...)) - How long the player has to look at the point RE: Scripting, need urgent help! - JetlinerX - 07-25-2011 ...Yeah... I'm VERY lost... RE: Scripting, need urgent help! - MrCookieh - 07-25-2011 What's the problem? You don't know what to insert? RE: Scripting, need urgent help! - JetlinerX - 07-25-2011 Yes, I have no idea what to put into those areas, or where... sorry :/ RE: Scripting, need urgent help! - MrCookieh - 07-25-2011 Creates a sound on an entity. asSoundName - internal name asSoundFile - the sound to use + extension .snt asEntity - the entity to create the sound at, can be “Player” afFadeTime - time in seconds the sound needs to fade abSaveSound - determines whether a sound should “remember” its state. If true, the sound is never attached to the entity! Also note that saving should on be used on looping sounds! AddTimer(string& asName, float afTime, string& asFunction); Creates a timer which calls a function when it expires. Callback syntax: void MyFunc(string &in asTimer) asName - the name of the timer afTime - time in seconds asFunction - the function to call if you're not sure, look at the amnesia wiki, there are all functions: http://wiki.frictionalgames.com/hpl2/amnesia/script_functions RE: Scripting, need urgent help! - JetlinerX - 07-25-2011 The thing I am not really understanding is the timer part. RE: Scripting, need urgent help! - MrCookieh - 07-25-2011 Well, you create a Timer, which resets after 1 second the view, so the player's view isn't focused on your object anymore. If you would add it after the StartPlayerLookAt(...), the camera panning would stop. So I added a timer, which executes after 1 second. the first parameter is just the timername, so this doesn't matter, the second one the time, after how much seconds the timer expires, and the third is the function to call. RE: Scripting, need urgent help! - JetlinerX - 07-27-2011 Okay, so I am only getting 1 fatal error, (Expected Identifier) its something with line 13,22. Here is that line of code. SetEntityCallbackFunc("notethree", "Func"); |