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
Sound playing when reading a note.
ZyLogicX Offline
Member

Posts: 245
Threads: 24
Joined: May 2011
Reputation: 6
#1
Sound playing when reading a note.

I have been trying to get examples from the main game, but it doesn't give me any direction where to go.
How would I approach said script?

Solved.

Beyond the Mountains of Madness [15%]
This forum is dying.
(This post was last modified: 07-02-2012, 09:31 PM by ZyLogicX.)
07-02-2012, 09:08 PM
Find
Mackiiboy Offline
Member

Posts: 101
Threads: 7
Joined: Jan 2012
Reputation: 11
#2
RE: Sound playing when reading a note.

(07-02-2012, 09:08 PM)ZyLogicX Wrote: I have been trying to get examples from the main game, but it doesn't give me any direction where to go.
How would I approach said script?
.
Select your note in the level editor and open the Entity menu to the right. Put in PickNote_01 at the CallbackFunc-box and save.

[Image: vuIJE.png]

Use this function in your hps script file and choose which music you want to play:

void PickNote_01(string &in entity, string &in type)
{
PlayMusic("nameofyourmusicfile.ogg", false, 0.7f, 0, 10, false);
}
07-02-2012, 09:23 PM
Website Find
Cruzore Offline
Senior Member

Posts: 301
Threads: 2
Joined: Jun 2012
Reputation: 37
#3
RE: Sound playing when reading a note.

That way it does play with you read, but when you close the journal, it still plays. And when you reopen the note, it won't play anymore. That is the closest you can get.
If you want the music to loop when reading the note, but want it to stop when not reading anymore, you could add a script area around where the player could stand(make sure he won't, just around it), add a collide callback inside the function from above, and let that callback function stop the music. Any player would go on after reading it, not just stand there thinking "duh", so that should be a good way of stopping the looping music.
But for the sound/music playing again when reading it a second time, I don't think that's possible

Think, before you speak Google, before you post
(This post was last modified: 07-02-2012, 09:48 PM by Cruzore.)
07-02-2012, 09:44 PM
Find




Users browsing this thread: 1 Guest(s)