![]() |
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-27-2011 Kyle Wrote:There is no SetEntityCallbackFunc.There is: Spoiler below!
Code: void OnEnter () This is your fixed code. A function works like this: First you need a callback, which 'calls' the function: (for example) SetEntityCallbackFunc("notethree", "Func"); -> This will call the function "Func". A function is a part of the code, which only runs through, if it's called. It starts with void FuncNameHere(ParametersHere){} In the brackets are the actions, which should be triggered, when the callback happens RE: Scripting, need urgent help! - JetlinerX - 07-27-2011 OMG!!! I GET IT NOW!!! I totally see what everyone was talking about! That code also works to play the sound! YESSSSSSS!!! One last thing, this is probably in the extra_eng most likely, but how do I make some sort of subtitle on the bottom after the sound, for instance: "That sound came from the attic right above me, whats going on?" Also, my second key is not working with this code and I have tried everything I can... Code: void OnEnter () RE: Scripting, need urgent help! - xiphirx - 07-27-2011 Check your syntax, you're missing a closing bracket for "UsedKeyOnDoor". Also, refer to http://wiki.frictionalgames.com/hpl2/amnesia/script_functions void SetMessage(string& asTextCategory, string& asTextEntry, float afTime); Displays a message on the screen. asTextCategory - the category in the .lang file asTextEntry - the entry in the .lang file afTime - determines how long the message is displayed. If time is < =0 then the life time is calculated based on string length. RE: Scripting, need urgent help! - JetlinerX - 07-27-2011 On the first "UsedKeyOnDoor" or the second? I cant see what one you mean as they both look the same. Also, where does that SetMessage go so that it knows when to come up? Also, I totally forgot about the Scripts Func page! Thanks for reminding me! RE: Scripting, need urgent help! - xiphirx - 07-27-2011 Ah, I didn't notice the scrollbar for your script ![]() Code: void OnEnter () Now pay attention to this part Code: AddUseItemCallback("", "keyone", "door1", "UsedKeyOnDoor", true); You're calling the same key function for both doors here, you just forgot the "2" for the second door Code: AddUseItemCallback("", "keyone", "door1", "UsedKeyOnDoor", true); RE: Scripting, need urgent help! - JetlinerX - 07-27-2011 OH CRAP! Nice call! Dang it, this stuff is so tedious! Hm, It would appear the door remains locked after using the key... ideas? RE: Scripting, need urgent help! - JenniferOrange - 07-27-2011 To set a message after the sound: { PlaySoundAtEntity("", "15_body_impact.snt", "Player", 0, false); PlaySoundAtEntity("", "react_pant5.snt", "Player", 0, false); StartPlayerLookAt("Player", 3.0f, 3.0f, ""); AddTimer("atticscare", 1, "OnPickup"); SetMessage("Messages", "scare", 0); } thats for your .hps . This is for your .lang file= Add this Category, if you don't already have it: Code: <CATEGORY Name="Messages"> And there you go! ![]() RE: Scripting, need urgent help! - JetlinerX - 07-27-2011 So the script is just reading it in order, so when the sounds play, it will read the message next? Interesting as 99% of the other parts of the code dont do that, which is why its so confusing! XD Thanks again "Jennifer" you always come through ![]() Ill let you all know what the results are. RE: Scripting, need urgent help! - JetlinerX - 07-27-2011 The message did not pop up after picking up the key :/ RE: Scripting, need urgent help! - JetlinerX - 07-28-2011 Got it working ^^^^ |