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 PlaySoundAtEntity bug
goodcap Offline
Member

Posts: 193
Threads: 112
Joined: Jun 2012
Reputation: 3
#1
PlaySoundAtEntity bug

I am working on a custom story and this is what i'm trying to do:

You walk to a door and you try to open it. It's locked and there's a memento added. It tell the player to get the key and you hear the writing sound effect.
This where the problem happens. The settings make it that when you click the door once, the script gets de-activated so you won't be getting 10 million mementos if you spam the door. This doesn't count for the PlaySoundAtEntity for some reason. If I spam click the door you keep hearing the writing noise.


This is my script:

void OnStart()
{
SetEntityPlayerInteractCallback("LibraryDoor", "LibDoor", true);
}

void LibDoor(string &in asEntity)
{
AddQuest("NeedKeyForLibDoor", "NeedKey");
PlaySoundAtEntity("", "MementoWriting.ogg", "Player", 0, false);
}

Everything works except that it does not disable the MementoWriting sound after the player clicked the door once.
05-11-2016, 09:34 PM
Find
Daemian Offline
Posting Freak

Posts: 1,129
Threads: 42
Joined: Dec 2012
Reputation: 49
#2
RE: PlaySoundAtEntity bug

Try this inside LibDoor function:
PHP Code: (Select All)
SetEntityPlayerInteractCallback("LibraryDoor"""true); 

05-11-2016, 11:59 PM
Find
Darkfire Offline
Senior Member

Posts: 371
Threads: 22
Joined: May 2014
Reputation: 15
#3
RE: PlaySoundAtEntity bug

Weird. Your code should work.

(05-11-2016, 11:59 PM)Daemian Wrote: Try this inside LibDoor function:
PHP Code: (Select All)
SetEntityPlayerInteractCallback("LibraryDoor"""true); 

Kudos to you, I actually didn't know you can override an interact callback with another one. This should work

05-12-2016, 08:38 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#4
RE: PlaySoundAtEntity bug

So basically the sound loops, not the function?

Maybe you should call a .snt instead of .ogg and edit it to make sure Loop="False". If you don't know how, just copy another .snt file and rename/edit it.

05-12-2016, 09:20 PM
Find
Spelos Away
Banned

Posts: 231
Threads: 19
Joined: Sep 2014
#5
RE: PlaySoundAtEntity bug

The AddQuest function creates the Memento writing sound.
Why are you playing it manually?
(This post was last modified: 05-14-2016, 07:40 AM by Spelos.)
05-14-2016, 07:39 AM
Find




Users browsing this thread: 1 Guest(s)