Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
phonograph music
nathanmcb Offline
Junior Member

Posts: 18
Threads: 6
Joined: Jun 2012
Reputation: 0
#1
phonograph music

how do I set the phonograph (the music box thingy) to play music when I turn the crank?
06-26-2012, 11:37 PM
Find
Obliviator27 Offline
Posting Freak

Posts: 792
Threads: 10
Joined: Jul 2011
Reputation: 66
#2
RE: phonograph music

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
Find
nathanmcb Offline
Junior Member

Posts: 18
Threads: 6
Joined: Jun 2012
Reputation: 0
#3
RE: phonograph music

(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
06-27-2012, 12:07 AM
Find
Obliviator27 Offline
Posting Freak

Posts: 792
Threads: 10
Joined: Jul 2011
Reputation: 66
#4
RE: phonograph music

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
Find
nathanmcb Offline
Junior Member

Posts: 18
Threads: 6
Joined: Jun 2012
Reputation: 0
#5
RE: phonograph music

(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*
06-28-2012, 12:14 AM
Find
Streetboat Offline
Posting Freak

Posts: 1,099
Threads: 40
Joined: Mar 2011
Reputation: 56
#6
RE: phonograph music

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.

[Image: signature-2.png]
06-28-2012, 06:29 PM
Find
nathanmcb Offline
Junior Member

Posts: 18
Threads: 6
Joined: Jun 2012
Reputation: 0
#7
RE: phonograph music

(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
06-28-2012, 06:37 PM
Find
Streetboat Offline
Posting Freak

Posts: 1,099
Threads: 40
Joined: Mar 2011
Reputation: 56
#8
RE: phonograph music

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.

[Image: signature-2.png]
06-28-2012, 07:38 PM
Find




Users browsing this thread: 1 Guest(s)