Frictional Games Forum (read-only)
[SCRIPT] How to make interacting with locked door play a 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 - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: [SCRIPT] How to make interacting with locked door play a sound? (/thread-20800.html)



How to make interacting with locked door play a sound? - serbusfish - 03-17-2013

When a locked door is attempted to be opened by the player I want a sound to played at a script area. I thought the 'SetEntityCallbackFunc' would work but it doesnt, I guess this command is only when picking entities such as Tinderboxes up?

Here is what I tried:

Code:
{

SetEntityCallbackFunc("mansion_1", "MonsterNoise");

}

void MonsterNoise(string &in asEntity, string &in type)
            
             {
            
                 PlaySoundAtEntity("", "pounding_low", "ScriptArea_monsterbang", 0.0f, false);
             }



RE: How to make interacting with locked door play a sound? - ExpectedIdentifier - 03-17-2013

(03-17-2013, 06:07 PM)serbusfish Wrote: When a locked door is attempted to be opened by the player I want a sound to played at a script area. I thought the 'SetEntityCallbackFunc' would work but it doesnt, I guess this command is only when picking entities such as Tinderboxes up?

Here is what I tried:

Code:
{

SetEntityCallbackFunc("mansion_1", "MonsterNoise", true);

}

void MonsterNoise(string &in asEntity, string &in type)
            
             {
            
                 PlaySoundAtEntity("", "pounding_low", "ScriptArea_monsterbang", 0.0f, false);
             }



PHP Code:
void MonsterNoise(string &in asEntity)
{
PlaySoundAtEntity("""pounding_low""ScriptArea_monsterbang"0.0ffalse);


Edit:
NaxEla's was correct, changing mine so you don't use the wrong code Tongue


RE: How to make interacting with locked door play a sound? - NaxEla - 03-17-2013

PHP Code:
void OnStart()
{
    
SetEntityPlayerInteractCallback("mansion_1""MonsterNoise"true);
}
void MonsterNoise(string &in asEntity)
{
    
PlaySoundAtEntity("""pounding_low""ScriptArea_monsterbang"0.0ffalse);