Frictional Games Forum (read-only)
phonograph music - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: phonograph music (/thread-16524.html)



phonograph music - nathanmcb - 06-26-2012

how do I set the phonograph (the music box thingy) to play music when I turn the crank?


RE: phonograph music - Obliviator27 - 06-26-2012

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/amnesia/script_functions for script reference.


RE: phonograph music - nathanmcb - 06-27-2012

(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/amnesia/script_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


RE: phonograph music - Obliviator27 - 06-27-2012

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"


RE: phonograph music - nathanmcb - 06-28-2012

(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*


RE: phonograph music - Streetboat - 06-28-2012

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.


RE: phonograph music - nathanmcb - 06-28-2012

(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


RE: phonograph music - Streetboat - 06-28-2012

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.