Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help How to make interacting with locked door play a sound?
serbusfish Offline
Member

Posts: 211
Threads: 75
Joined: Aug 2012
Reputation: 0
#1
How to make interacting with locked door play a sound?

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:

{

SetEntityCallbackFunc("mansion_1", "MonsterNoise");

}

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

03-17-2013, 06:07 PM
Find
ExpectedIdentifier Offline
Member

Posts: 234
Threads: 10
Joined: Sep 2012
Reputation: 11
#2
RE: How to make interacting with locked door play a sound?

(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:

{

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

}

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



PHP Code: (Select All)
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
(This post was last modified: 03-17-2013, 07:07 PM by ExpectedIdentifier.)
03-17-2013, 06:23 PM
Find
NaxEla Offline
Senior Member

Posts: 415
Threads: 5
Joined: Dec 2012
Reputation: 28
#3
RE: How to make interacting with locked door play a sound?

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


In Ruins [WIP]
03-17-2013, 07:02 PM
Find




Users browsing this thread: 1 Guest(s)