PlayMusicAtEntity - 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: PlayMusicAtEntity (/thread-19198.html) |
PlayMusicAtEntity - tonitoni1998 - 11-12-2012 what is wrong with this code? void area_scare_5(string &in asParent, string &in asChild, int alState) { PlayMusicAtEntity(string& scare_tingeling.snt, bool Loop, float 7, float 3, int 1, bool true); } im sorry to made you notice this again, but i really need help :/ RE: PlayMusicAtEntity - The chaser - 11-12-2012 void area_scare_5(string &in asParent, string &in asChild, int alState) { PlayMusicAtEntity(scare_tingeling.snt, false, 7, 3, 1, true); } Those words weren't necessary, Toni XD they are for sintaxes and structures. RE: PlayMusicAtEntity - FlawlessHappiness - 11-12-2012 There is nothing called PlayMusicAtEntity. It's PlaySoundAtEntity RE: PlayMusicAtEntity - Adny - 11-12-2012 "PlayMusicAtEntity" is not a function. You need to make a .snt file for the .ogg and use "PlaySoundAtEntity". Good luck! RE: PlayMusicAtEntity - The chaser - 11-12-2012 (11-12-2012, 07:49 PM)beecake Wrote: There is nothing called PlayMusicAtEntity.How could I... please someone facepalm me. RE: PlayMusicAtEntity - tonitoni1998 - 11-13-2012 thanks to you guys. how can i make this loop: void area_scare_5(string &in asParent, string &in asChild, int alState) { PlaySoundAtEntity ("", "scare_whine_loop3.snt", "Player", 0, true); } RE: PlayMusicAtEntity - FlawlessHappiness - 11-13-2012 What kind of loop? The sound you are using is already looping isn't it? If it isn't then: void area_scare_5(string &in asParent, string &in asChild, int alState) { AddTimer("LoopSound", 0, "LoopTimer"); } void LoopSound(string &in asTimer) { if(asTimer == "LoopSound") { PlaySoundAtEntity ("", "scare_whine_loop3.snt", "Player", 0, true); AddTimer("LoopSound", 5, "LoopTimer"); ) } RE: PlayMusicAtEntity - tonitoni1998 - 11-13-2012 (11-13-2012, 03:07 PM)beecake Wrote: What kind of loop? The sound you are using is already looping isn't it? If it isn't then:thank you. well yes "whine_loop" sounds like a loop to me too, but its not looping :/ but now it is if you could help me once again... i dont understand the wiki script examples... i tried to fade in a sound: void area_scare_1(string &in asParent, string &in asChild, int alState) { PlaySoundAtEntity("", "react_pant.snt", "Player", 0, true); PlaySoundAtEntity("", "break_glass_large.snt", "Player", 0, true); FadeInSound ("", "ui_torture.snt", "Player", 0, true); GiveSanityDamage(90.0f, true); } i know this is very wrong, because i dont understand what all this "string&" "float" "bool" is. the only thing i did in java is a hello world, thats wh i dont really get all this stuff this is what the wiki says: void FadeInSound(string& asSoundName, float afFadeTime, bool abPlayStart); RE: PlayMusicAtEntity - FlawlessHappiness - 11-13-2012 i should tell you how to stop it too... If you have this sound playing all through your game it will be very annoying! This is how the script should look: void LoopSound(string &in asTimer) { if(asTimer == "LoopSound") { if(GetLocalVarInt("StopLoopSound") == 1) { return; } PlaySoundAtEntity ("", "scare_whine_loop3.snt", "Player", 0, true); AddTimer("LoopSound", 5, "LoopTimer"); } } Then if you want to stop the loop you just make a script that calls: SetLocalVarInt("StopLookSound", 1); For the fade in sound: This line can fade in sounds: PlaySoundAtEntity("", "break_glass_large.snt", "Player", 0, true); The 0 determines how many seconds it should fade, until it has reached full volume string = Letters float = Numbers bool = True or false You might want to see this too: http://www.frictionalgames.com/forum/thread-18368.html RE: PlayMusicAtEntity - tonitoni1998 - 11-13-2012 THANK YOU. you really helped me i will try to get my answers by myself in future |