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
TheIcyPickle Offline
Member

Posts: 80
Threads: 16
Joined: Feb 2011
Reputation: 0
#1
Phonograph

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);
}
06-07-2012, 01:55 AM
Find
Damascus Offline
Senior Member

Posts: 646
Threads: 118
Joined: Mar 2012
Reputation: 29
#2
RE: Phonograph

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

06-07-2012, 02:03 AM
Find
TheIcyPickle Offline
Member

Posts: 80
Threads: 16
Joined: Feb 2011
Reputation: 0
#3
RE: Phonograph

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
(This post was last modified: 06-07-2012, 02:21 AM by TheIcyPickle.)
06-07-2012, 02:08 AM
Find
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#4
RE: Phonograph

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

I rate it 3 memes.
06-07-2012, 03:17 AM
Find
TheIcyPickle Offline
Member

Posts: 80
Threads: 16
Joined: Feb 2011
Reputation: 0
#5
RE: Phonograph

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/vi...a#imagebox


this is what I mean. (pretend that the crank works properly because at the time it did not, but now it does.)
06-07-2012, 03:48 AM
Find
FragdaddyXXL Offline
Member

Posts: 136
Threads: 20
Joined: Apr 2012
Reputation: 7
#6
RE: Phonograph

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.

Dark Seclusion Here
(This post was last modified: 06-07-2012, 06:15 AM by FragdaddyXXL.)
06-07-2012, 06:09 AM
Find
TheIcyPickle Offline
Member

Posts: 80
Threads: 16
Joined: Feb 2011
Reputation: 0
#7
RE: Phonograph

thank you Ill test all this out! I love this forum, everyone is so helpful Tongue
06-07-2012, 08:31 PM
Find




Users browsing this thread: 2 Guest(s)