Frictional Games Forum (read-only)

Full Version: Interact with door script
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
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);
}
probally speaker1 cant play the sound u hav to choose another thing to play the sound in?
I tried a bunch of entities but it doesnt work
for playmusicbox u put (string &in asEntity)

right after playmusicbox

also u hav to put the volume to 1
I'm sorry. What do you mean?
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.
I got it to work. Thanks guys Smile
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.
i name my area lol1, lol2, lol3, lol4 but only jumpscares...............................................gdfgwahegWFL GKAWNRLKG NWLAR GJ;KLAWEB
(07-21-2014, 10:40 PM)victorkim890(KimmyChimmy) Wrote: [ -> ]gdfgwahegWFL GKAWNRLKG NWLAR GJ;KLAWEB

did you have a stroke
Pages: 1 2