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
sound question
Soverain Offline
Junior Member

Posts: 18
Threads: 5
Joined: Jul 2012
Reputation: 1
#7
RE: sound question

(07-31-2012, 02:55 AM)andyrockin123 Wrote: "21_scream10" can't be used in this function. The string used for the sound name must be a .snt (sound configuration) file. The only available .snt file that includes that specific sound (as well as 11 others the .snt chooses at random) is "21_screams". Your function should be:

PlaySoundAtEntity("secretkey", "21_screams", "Player", 1, false);


Hope that helped.

Also, you don't need an internal name unless you intend to use a function like StopSound or FadeInSound (both of which only use the internal name, not the actual name of a .snt file). You can leave it blank ("") if you'd like.
I'm afraid the sound is still not working when the head appears...

my entire script


////////////////////////////
// Run when entering map
void OnStart()
{
AddEntityCollideCallback("smash", "break", "FUNC", true, 0);
AddUseItemCallback("", "secretkey", "door1", "UsedKeyOnDoor", true);
PlayMusic("25_amb.ogg", true, 1, 1, 0, false);
SetEntityCallbackFunc("secretkey", "scream");
SetEntityConnectionStateChangeCallback("shelf", "func_shelf");
}

void FUNC(string &in asParent, string &in asChild, int alState)
{
SetPropHealth("door", 0.0f);
}


void UsedKeyOnDoor(string &in asItem, string &in asEntity)

{

SetSwingDoorLocked("door1", false, true);
PlaySoundAtEntity("", "unlock_door", "door1", 0, false);
RemoveItem("secretkey");
}
void scream(string &in asEntity, string&in type)
{
PlaySoundAtEntity("", "21_screams", "player", 1, false);
SetEntityActive("head",true);
}

void func_shelf(string &in asEntity, int alState)
{
if (alState == 1)
{
SetMoveObjectState("secret",1.0f);
PlaySoundAtEntity("", "quest_completed.snt", "shelf_move_1", 0, false);
return;
}
}

////////////////////////////
// Run when entering map
void OnEnter()
{

}


void LockedDoor(string &in entity)
{
if(GetSwingDoorLocked("door") == true)
{
SetMessage("Messages","msg",0);
}
}

void DoorLocked(string &in entity)
{
if(GetSwingDoorLocked("door1") == true)
{
SetMessage("Messages","locked",0);
}
}

void obstacle(string &in entity)
{
if(GetSwingDoorLocked("door2") == true)
{
SetMessage("Messages","block",0);
}
}


////////////////////////////
// Run when entering map
void OnLeave()
{

}
07-31-2012, 03:44 AM
Find


Messages In This Thread
sound question - by Soverain - 07-31-2012, 01:08 AM
RE: sound question - by ksnider - 07-31-2012, 01:59 AM
RE: sound question - by Soverain - 07-31-2012, 02:06 AM
RE: sound question - by ksnider - 07-31-2012, 02:10 AM
RE: sound question - by Soverain - 07-31-2012, 02:47 AM
RE: sound question - by Adny - 07-31-2012, 02:55 AM
RE: sound question - by Soverain - 07-31-2012, 03:44 AM
RE: sound question - by Adny - 07-31-2012, 03:50 AM
RE: sound question - by Soverain - 07-31-2012, 04:01 AM



Users browsing this thread: 1 Guest(s)