01-07-2015, 10:07 AM
So I am trying, just a test to see if I can make a custom sound/music work in the game. Now I followed a guide which told me what to do, where to put the files and stuff. But when I'm done scripting I have no idea why it doesn't work.
Could anyone look into it? And give me some tips?
Thanks!
Here is my script.
VVVVVVVVVVVVVVVVVVVVVVVVVVVVV
I should also mention this one too.
ALSO!
If I try to play the OGG file in Windows Mediaplayer I can hear the sound play, but if I try to place the sound in the world in the editor I can't hear it when I try to preview it with the play button, or if I place it in the world and load the map I can't hear the sound play.
Could anyone look into it? And give me some tips?
Thanks!
Here is my script.
VVVVVVVVVVVVVVVVVVVVVVVVVVVVV
Spoiler below!
void OnStart()
{
AddEntityCollideCallback("Player", "Ambience", "Ambience1", true, 1);
}
void Ambience1(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "CustomTest.snt", "Player", 0.0f, false);
}
{
AddEntityCollideCallback("Player", "Ambience", "Ambience1", true, 1);
}
void Ambience1(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "CustomTest.snt", "Player", 0.0f, false);
}
I should also mention this one too.
Spoiler below!
<SOUNDENTITY>
<SOUNDS>
<Main>
<Sound File="CustomTest.ogg" />
</Main>
</SOUNDS>
<PROPERTIES Volume="5" MinDistance="1" MaxDistance="50" Random="0" Interval="0" FadeEnd="False" FadeStart="False" Stream="False" Loop="False" Use3D="false" Blockable="False" BlockVolumeMul="0.7" Priority="5" />
</SOUNDENTITY>
<SOUNDS>
<Main>
<Sound File="CustomTest.ogg" />
</Main>
</SOUNDS>
<PROPERTIES Volume="5" MinDistance="1" MaxDistance="50" Random="0" Interval="0" FadeEnd="False" FadeStart="False" Stream="False" Loop="False" Use3D="false" Blockable="False" BlockVolumeMul="0.7" Priority="5" />
</SOUNDENTITY>
ALSO!
If I try to play the OGG file in Windows Mediaplayer I can hear the sound play, but if I try to place the sound in the world in the editor I can't hear it when I try to preview it with the play button, or if I place it in the world and load the map I can't hear the sound play.