Frictional Games Forum (read-only)

Full Version: phonograph music
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
how do I set the phonograph (the music box thingy) to play music when I turn the crank?
void OnStart()
{
SetEntityConnectionStateChangeCallback("EntityName", "DesiredCallback");
}
void DesiredCallback(string &in asEntity, int alState)
{
if(alState == 1)
{
PlayMusic(Insert arguments here, because I don't know what you want.)
SetEntityInteractionDisabled(asEntity, true);
}
}

http://wiki.frictionalgames.com/hpl2/amn..._functions for script reference.
(06-26-2012, 11:46 PM)Obliviator27 Wrote: [ -> ]void OnStart()
{
SetEntityConnectionStateChangeCallback("EntityName", "DesiredCallback");
}
void DesiredCallback(string &in asEntity, int alState)
{
if(alState == 1)
{
PlayMusic(Insert arguments here, because I don't know what you want.)
SetEntityInteractionDisabled(asEntity, true);
}
}

http://wiki.frictionalgames.com/hpl2/amn..._functions for script reference.
ok this might be a little noobish but....
the song track is "myuu" and its .ogg
it keeps coming up myuu not declared? please help
You're declaring it as a variable.
Whenever you see a parameter that requires a string value, make sure to encase it in quotation marks.
"myuu.ogg"
(06-27-2012, 01:18 AM)Obliviator27 Wrote: [ -> ]You're declaring it as a variable.
Whenever you see a parameter that requires a string value, make sure to encase it in quotation marks.
"myuu.ogg"
ok got it thanks Big Grin *brohoof*
It might be better to place a script entity at the phonograph and create a .snt file for the music, then tell the script to PlaySoundAtEntity and use the script area at the phonograph, that way it'll sound like the music is actually playing from the phonograph. Make sure you edit the .snt to use 3d effects, and change the sound radius to the size you want.
(06-28-2012, 06:29 PM)Streetboat Wrote: [ -> ]It might be better to place a script entity at the phonograph and create a .snt file for the music, then tell the script to PlaySoundAtEntity and use the script area at the phonograph, that way it'll sound like the music is actually playing from the phonograph. Make sure you edit the .snt to use 3d effects, and change the sound radius to the size you want.
can you do the basic script for me then please? Smile
No, because it requires just one line difference from what Obliviator posted. The main difference is that instead of using a simple .ogg file, you need to have a .snt file (what Amnesia uses to have all the parameters set up for various sound effects in-game), which is easily edited in a text program, and you need to place a script area where the phonograph is.

Also, you won't learn anything if you have other people do it for you. I told you exactly how to do everything, but I can't physically get into your computer and create the .snt file or the script area for you.