[SCRIPT] Interact with door script - 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: [SCRIPT] Interact with door script (/thread-25728.html) Pages:
1
2
|
Interact with door script - goodcap - 07-21-2014 I'm trying to make it that when you try to open a door which is locked you hear a voice coming from a speaker. When I interact with the door I don't hear anything. This is my script: void OnStart() { SetEntityPlayerInteractCallback("PlayMusicBox", "PlayMusicBox", false); } void PlayMusicBox(string &in asEntity, int alState) { PlaySoundAtEntity("", "16_puzzle_bridge.snt", "speakers_1", 0.05f, false); } RE: Interact with door script - victorkim890(KimmyChimmy) - 07-21-2014 probally speaker1 cant play the sound u hav to choose another thing to play the sound in? RE: Interact with door script - goodcap - 07-21-2014 I tried a bunch of entities but it doesnt work RE: Interact with door script - victorkim890(KimmyChimmy) - 07-21-2014 for playmusicbox u put (string &in asEntity) right after playmusicbox also u hav to put the volume to 1 RE: Interact with door script - goodcap - 07-21-2014 I'm sorry. What do you mean? RE: Interact with door script - Mudbill - 07-21-2014 The callback syntax for SetEntityPlayerInteractCallback is PHP Code: void MyFunc(string &in asEntity) The int alState does not belong there. Also, when using PlaySoundAtEntity, I recommend using a ScriptArea because they're more reliable. RE: Interact with door script - goodcap - 07-21-2014 I got it to work. Thanks guys RE: Interact with door script - Mudbill - 07-21-2014 Is "lol" the name of the script area? Is your script file properly loaded? Is the sound file found? I think if you go to Documents\Amnesia\Main and look at hpl.log, it might mention any errors or warnings. RE: Interact with door script - victorkim890(KimmyChimmy) - 07-21-2014 i name my area lol1, lol2, lol3, lol4 but only jumpscares...............................................gdfgwahegWFL GKAWNRLKG NWLAR GJ;KLAWEB RE: Interact with door script - Nice - 07-21-2014 (07-21-2014, 10:40 PM)victorkim890(KimmyChimmy) Wrote: gdfgwahegWFL GKAWNRLKG NWLAR GJ;KLAWEB did you have a stroke |