The trick with the sound - 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: The trick with the sound (/thread-4457.html) Pages:
1
2
|
The trick with the sound - Dismortal - 09-17-2010 Hello. First, i must say sorry if my englisch is awful. I´ve never write scripts and now I really need help. I had read the threads with questions about sounds and scripting and tried some. Nothing works. I had read the original scripts from the game to get an idea to script. It dont work. What dont work? I´ve tried to play a simple sound when I use a looked door. After spending hours in trying I get discouraged. Can someone help and explane me the "magic" of scripting? Befor I forget. I dont have the problem to write a understandable script for the game. The script just dont do what I want. Thanks for your patience und help. RE: The trick with the sound - jens - 09-17-2010 Hard to give any advice without you showing what you have done. Post the script with the part for the door and that is a starting point. RE: The trick with the sound - Dismortal - 09-17-2010 Quote:void PlaySoundAtEntity This is all what i have. I know I need more than that. RE: The trick with the sound - jens - 09-17-2010 I think best is to look through http://hpl2.frictionalgames.com/tutorials:amnesia_script:tutorial_1 Short version: You need to select the door in the level editor and in the Entity tab, under PlayerInteractCallback type InteractingWithDoor Then you have to have a proper default script file to begin with (there is one in the tutorial). Open your you default script file and anywhere that is NOT in OnStart, OnEnter or OnLeave write the function for that callback you just type into the editor. Like this: Code: void InteractingWithDoor(string &in asEntity) Also make sure that you really have that ScriptArea_1 in the level. If you do not see the debug message or hear the sound, the function was not triggered at all. RE: The trick with the sound - Dismortal - 09-17-2010 Wow, it works Thank you Jens. Now I know my problem. It was the association between the script and the callback function in the level editor. I will read the tutorial to improve my knowledge about scripting. After I know that, I feel like a fool. Thanks again. RE: The trick with the sound - Cgturner - 09-17-2010 Jens, I used this: Code: void InteractingWithDoor(string &in asEntity) RE: The trick with the sound - jens - 09-17-2010 You check the box that is below the PlayerINteractCallback in the level editor. I think the name is PlayerInteractCallbackAutoRemove. RE: The trick with the sound - Cgturner - 09-17-2010 (09-17-2010, 04:24 PM)jens Wrote: You check the box that is below the PlayerINteractCallback in the level editor. I think the name is PlayerInteractCallbackAutoRemove.Why yes it is! I knew I missed something. Thank you for the swift and helpful response. RE: The trick with the sound - Requiem - 09-19-2010 Hi I want to play a sound when the player go across an area, but I have to admit, my script doesn't work : / xD it look like : void CollidePlayerWithAreaCreep() { PlaySoundAtEntity("Creep", "scare_animal_squeal.snt", "Player", 1, false); } Who can help me ?? ^^ Thx =p RE: The trick with the sound - Pandemoneus - 09-19-2010 void CollidePlayerWithAreaCreep(string &in asParent, string &in asChild, int alState) { PlaySoundAtEntity("Creep", "scare_animal_squeal.snt", "Player", 1, false); } Here you go! |