Frictional Games Forum (read-only)

Full Version: Cant have PlaySoundAtEntity with SetSwingDoorClosed?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
void CollideRoomTwo(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("mansion_1", true, true);
PlaySoundAtEntity("", "react_scare1.ogg", "Player", 0, false);
}

Ok so when I move through a locked door which I unlock with a key, it slams behind me, but does not play the sound file I have set above..

void UsedKey1OnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "mansion_1", 0, false);

}


However a sound effect + entity effect works here.. why not with the other one?

I am getting no errors or anything from starting the custom story, the sound refuses to play. I even tried setting the sound to come from something else like a vase or the door itself, but still no dice.
PlayGuiSound("react_scare", 1.0f);

It's a GUI sound, I'm assuming that's the problem, paste the command above.
you're using .ogg for the one that doesn't work, and .snt for the one that does work
PlaySoundAtEntity HAS to be .snt
you can't use .ogg
Nope neither of those suggestions seem to work either..

Also what does GUI stand for?
There must be a snt file for it to work, so if you simply tried react_scare1.snt that does not work, but I think there is a react_scare.snt which will randomly select one of the react_scareX.ogg to play.
(05-05-2011, 08:48 AM)jens Wrote: [ -> ]There must be a snt file for it to work, so if you simply tried react_scare1.snt that does not work, but I think there is a react_scare.snt which will randomly select one of the react_scareX.ogg to play.

Tried that and it still does not work..

void CollideRoomTwo(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("mansion_1", true, true);
PlaySoundAtEntity("", "react_scare.snt", "Player", 0, false);

}

I have tried different variations of of the sound file name as well as the target entity (player).. do i need someone in the first quotations? i didnt for the other script line with the door?
void CollideRoomTwo(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("mansion_1", true, true);
PlayGuiSound("react_scare", 1.0f);
}

This is what I do, works all the time, so no idea.
(05-05-2011, 08:58 AM)cook Wrote: [ -> ]void CollideRoomTwo(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("mansion_1", true, true);
PlayGuiSound("react_scare", 1.0f);
}

This is what I do, works all the time, so no idea.

I copied/pasted that directly replacing my current one and doesnt work.

I even created a SECOND area that sits with the first area:

////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "key1", "mansion_1", "UsedKey1OnDoor", true);
PlayMusic("04_amb.ogg", true, .5, 3, 0, true);
AddEntityCollideCallback("Player", "RoomTwoArea", "CollideRoomTwo", true, 1);
AddEntityCollideCallback("Player", "RoomTwoArea2", "CollideRoomTwo2", true, 1);

}

void CollideRoomTwo(string &in asParent, string &in asChild, int alState)
{

SetSwingDoorClosed("mansion_1", true, true);
PlayGuiSound("react_scare", 1.0f);

}

void CollideRoomTwo2(string &in asParent, string &in asChild, int alState)
{

PlayGuiSound("react_scare", 1.0f);

}


And yet it still doesnt work.. im at a complete loss here lol
Hmm that seems really weird. I would double check to make sure your sound files are still in their proper place and named correctly? Just a thought since your code does look good. Maybe I'm just not seeing it...
Code:
void UsedKeyOnDoor2(string &in asItem, string &in asEntity)
{
    SetSwingDoorLocked("StartDoor2", false, true);
    PlaySoundAtEntity("", "unlock_door", "StartDoor2", 0, false);

this is actual scripting from the conversion i'm working on
works fine for me

make sure that the third thing typed in (the one next to "unlock_door") is the actual name of the door

other than that, i have no idea why it's not working :/

edit:

try:
Code:
void CollideRoomTwo(string &in asParent, string &in asChild, int alState)
{
    SetSwingDoorClosed("mansion_1", true, true);
    PlaySoundAtEntity("", "react_scare", "mansion_1", 0, false);
}
Pages: 1 2