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
P_Tut - Valve & Slide Door - Example
plantum Offline
Junior Member

Posts: 4
Threads: 1
Joined: Jul 2011
Reputation: 0
#6
Music  RE: P_Tut - Valve & Slide Door - Example

(07-10-2011, 07:40 PM)HumiliatioN Wrote:
(07-10-2011, 07:02 PM)Jordo76 Wrote: A void OnLeave on the map where you Leave ?
void OnLeave
{
StopMusic(4, 1);
}
No ?

I tried everything but no luck. This is so frustrating. When i change that prioty 1 or 0 then "Track never starts playing" :/

Well, i was hoping that guyz will come here with proper questions (about valve) but is alright, i will try to help.

It would be a lot easier if i could see this map and script, so if you can, somehow, pls send it to me, or post somewhere.

My first though- Your Music (number 1) never stops playing CAUSE next music (number 2) never comes up. I see script, and its can be wrong or something, i guess, first you should try turn off first music (number 1) and make sure that the script (number 2) is working correctly and its playing second music (number 2).


When i woke up this morning i tried some things, and this is what i can tell:

When you have two maps, with two musics on the same priorty, the music is changing automatic (you dont need no "StopMusic" command.) This works also when priorities are different
Its not perfect but its work.

So the easiest way to do this is just put the "PlayMusic" command in the place "OnEnter", and game will change music when you enter to another map automatically (one music will fade to another).

What i discovered, i think
When you change map (i.e. 1 >> 2 ), and you come back ( 2 >> 1 ) - the music is not playing from the start(begging), so
i guess it means that the game its saving the its progress(music progress) OR the music just never stop playing.

How i did it?

void OnLeave()
{
StopMusic(5, 10);
}

If you wont put that in your script. The music will always play from the begging.(as you enter the map)

======================================
Try my example and tell me if that is what you want, check it and tell me what you think, maybe you want something different, i don't know.


Attached Files
.zip   P_Tutorial-LevelToLevel_ChangeMusic.zip (Size: 70.66 KB / Downloads: 208)
07-11-2011, 07:52 AM
Find


Messages In This Thread
P_Tut - Valve & Slide Door - Example - by plantum - 07-10-2011, 03:30 PM
RE: P_Tut - Valve & Slide Door - Example - by plantum - 07-11-2011, 07:52 AM



Users browsing this thread: 1 Guest(s)