(02-01-2015, 09:02 PM)Neelke Wrote: It's because you're starting "general_piano01" and "02_amb_safe" right as you start the map. When do you want these sounds/musics to start?
Yeah i figured that out and managed to separate "21_intro_scream.snt" and "general_piano01.snt" to play in separately placed areas when i enter them. I guess i'm back to square one right now. I can't figure out how to write in the script so that music will start playing when i enter a certain area given on the map.
Using this one now:
void OnStart()
{
AddEntityCollideCallback("Player", "Flaska", "PlaySound", true, 1);
AddEntityCollideCallback("Player", "Ljud", "start", true, 1);
AddUseItemCallback("", "Key", "Door", "UseKeyOnDoor", true);
AddUseItemCallback("", "Nyckel", "Rumpa", "UseKeyOnDoor", true);
AddUseItemCallback("", "Tillskåp", "Skåp", "UseKeyOnDoor", true);
}
void UseKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);
PlaySoundAtEntity("", "Unlock_door.snt", asEntity, 10, false);
RemoveItem(asItem);
}
void start(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "general_piano01.snt", "Player", 1, false);
}
void PlaySound(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "21_intro_scream.snt", "Player", 1, false);
}