07-18-2012, 09:12 PM
So I have this code set up and I want it to play a sound when someone finished reading a note. I tried using this code:
////////////////////////////
// Run when starting map
void OnStart()
{
AddUseItemCallback("", "key_study_1", "mansion_3", "KeyOnDoor2", true);
SetEntityPlayerInteractCallback("note_paper01_3", "ScareNoise1", true);
}
////////////////////////////
// Run when entering map
void OnEnter()
{
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}
void ActivateMonster(string &in asItem)
{
}
void KeyOnDoor2(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);
PlaySoundAtEntity("", "unlock_door", asEntity, 0.0f, false);
RemoveItem(asItem);
}
void ScareNoise1()
{
PlaySoundAtEntity("", "scare_baby_cry1.ogg", "Player", 0, false);
PlaySoundAtEntity("", "scare_steps_big5.ogg", "Player", 0, false);
PlaySoundAtEntity("", "scare_tingeling_rev2.ogg", "Player", 0, false);
}
It wont however work, but thanfully doesnt crash or give me any errors. Do I need to use something other than
SetEntityPlayerInteractCallback to make it work with a note?
EDIT: Sorry, I said "a" sound but I actually want it to play a chorus of those three sounds at once.
////////////////////////////
// Run when starting map
void OnStart()
{
AddUseItemCallback("", "key_study_1", "mansion_3", "KeyOnDoor2", true);
SetEntityPlayerInteractCallback("note_paper01_3", "ScareNoise1", true);
}
////////////////////////////
// Run when entering map
void OnEnter()
{
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}
void ActivateMonster(string &in asItem)
{
}
void KeyOnDoor2(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);
PlaySoundAtEntity("", "unlock_door", asEntity, 0.0f, false);
RemoveItem(asItem);
}
void ScareNoise1()
{
PlaySoundAtEntity("", "scare_baby_cry1.ogg", "Player", 0, false);
PlaySoundAtEntity("", "scare_steps_big5.ogg", "Player", 0, false);
PlaySoundAtEntity("", "scare_tingeling_rev2.ogg", "Player", 0, false);
}
It wont however work, but thanfully doesnt crash or give me any errors. Do I need to use something other than
SetEntityPlayerInteractCallback to make it work with a note?
EDIT: Sorry, I said "a" sound but I actually want it to play a chorus of those three sounds at once.