Frictional Games Forum (read-only)
Phonograph - 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 (/thread-15917.html)



Phonograph - TheIcyPickle - 06-07-2012

Hello!

I would like it so that when player is DONE with the action of rotating the little lever thing on the phonograph it plays music from the phonograph. (And how would one do this if player sticks a "music tinderbox" thing in the phonograph)

I tried a InteractCallback, it works, but it just plays when you touch the phonograph... not when the player is done rotating it.

my original InteractCallback:


void OnStart()
{
SetEntityPlayerInteractCallback("phonograph_1", "PlayMusic", true);




}

void PlayMusic(string &in asEntity)
{
PlayMusic("Fallout New Vegas Soundtrack - Jingle Jangle Jingle.ogg", false, 0.5, 0, 0, true);
}


RE: Phonograph - Damascus - 06-07-2012

I think you will want to use a State Change script instead, such as:

void SetEntityConnectionStateChangeCallback(string& asName, string& asCallback);



A callback called when ever the connection state changes (button being switched on, lever switched, etc).


Callback syntax: void Func(string &in asEntity, int alState)


alState: -1 = off, 0 = between, 1 = on


RE: Phonograph - TheIcyPickle - 06-07-2012

you are amazing, you know what, the community here at frictional is really something. Really friendly and provide an answer really f**king fast.

Thank you!

But is there a way to play the music at the phonograph? Or make it seem like it? I could add a staticy effect to the music, but, I do want it to fade as a player walks away from the phonograph.

oh and when you use the "waxoll record" things how does one set it so when player uses it in the phonograph, then phonograph become unlocked


RE: Phonograph - Adny - 06-07-2012

(06-07-2012, 02:08 AM)TheIcyPickle Wrote: you are amazing, you know what, the community here at frictional is really something. Really friendly and provide an answer really f**king fast.

Thank you!

But is there a way to play the music at the phonograph? Or make it seem like it? I could add a staticy effect to the music, but, I do want it to fade as a player walks away from the phonograph.

oh and when you use the "waxoll record" things how does one set it so when player uses it in the phonograph, then phonograph become unlocked
PlayGuiSound or PlayMusic would work. You will need an .ogg and a .snt for this.


RE: Phonograph - TheIcyPickle - 06-07-2012

right I know, but, ok. So, It works. When I pull the crank and when the crank stops it plays the music

BUT

I want it to play when player first uses a waxoll record (because the phonograph will be frozen until it is placed in like in justine Big Grin)

So when player uses waxoll record on phonograph, then pulls the crank, music plays.

not just pull then crank and play (w/no waxoll)

Also, is there a way so the music is played through the phonograph (or simulated to)

http://www.moddb.com/mods/eremophobia/videos/example-footage-of-the-record-player-idea#imagebox


this is what I mean. (pretend that the crank works properly because at the time it did not, but now it does.)


RE: Phonograph - FragdaddyXXL - 06-07-2012

Yes, there is a way for it to sound like it's coming from the phonograph, but there is a problem. Whenever you walk out of hearing range, the audio will stop (which is expected) BUT when you walk back into range, the audio clip will play from the beginning.

You will need to use:

PlaySoundAtEntity(string& asSoundName, string& asSoundFile, string& asEntity, float afFadeTime, bool abSaveSound);


In the .snt file for your music, you will need to make sure these parameters are met:
Loop="True"
Use3D="True"
Blockable="True"
Priority="0"

These next parameters are unique to your situation, so you will need to set them yourself:
Volume="0.85"
MinDistance="2"
MaxDistance="60"
BlockVolumeMul="0.7"

Just copy a pre-made .snt file from some random audio clip, and rename and match it to your sound file.

As for the waxroll part, I wouldn't really know how to get into the specifics, but sounds like you need to add the SetEntityConnectionStateChangeCallback(string& asName, string& asCallback); after/when you use the waxroll. This will make it so that, until you place the waxroll, the script will have no chance to trigger the music.


RE: Phonograph - TheIcyPickle - 06-07-2012

thank you Ill test all this out! I love this forum, everyone is so helpful Tongue