Frictional Games Forum (read-only)

Full Version: Music and dying
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hey guys, I know how to add music such that it plays and all works fine, provided you never die. I think I'm missing something here, because whenever you die, the music either stops playing, or goes to the music file that was played in the previous area. What's going on here? is it perhaps a difference between putting PlayMusic in OnStart or OnEnter?
Yes, there IS a difference between putting music in OnStart or OnEnter. You have to put it in OnEnter because it is called IF YOU SPAWN. OnStart is only called on the BEGINNING and ONLY ONE TIME.
OnEnter is not called when you spawn after dying. The current active checkpoint, however, is (the game automatically creates a checkpoint at the start of the map). Nevertheless, you should play your music in OnEnter.
(04-24-2012, 11:18 PM)Your Computer Wrote: [ -> ]OnEnter is not called when you spawn after dying. The current active checkpoint, however, is (the game automatically creates a checkpoint at the start of the map). Nevertheless, you should play your music in OnEnter.
Wait, so playing the music in OnEnter will restart it when I spawn after death? What if my level has multiple checkpoints? How does the game set checkpoints?
I always put my music in OnStart
(04-25-2012, 07:22 PM)Bennick Wrote: [ -> ]Wait, so playing the music in OnEnter will restart it when I spawn after death? What if my level has multiple checkpoints? How does the game set checkpoints?

I did not say playing the music in OnEnter would restart the music when spawning after death.

The game automatically sets one checkpoint when you first enter the map. You can set your own checkpoints by using the CheckPoint function. Only one checkpoint can be active at any one time.
(04-25-2012, 08:01 PM)Your Computer Wrote: [ -> ]
(04-25-2012, 07:22 PM)Bennick Wrote: [ -> ]Wait, so playing the music in OnEnter will restart it when I spawn after death? What if my level has multiple checkpoints? How does the game set checkpoints?

I did not say playing the music in OnEnter would restart the music when spawning after death.

The game automatically sets one checkpoint when you first enter the map. You can set your own checkpoints by using the CheckPoint function. Only one checkpoint can be active at any one time.
Okay, but I still don't understand. How do I get it so that the music that was playing when the new checkpoint was set plays after death and respawn?
Can anyone help?
(05-01-2012, 10:44 PM)Bennick Wrote: [ -> ]Can anyone help?

Do you know how to use callbacks?
(05-01-2012, 11:04 PM)Your Computer Wrote: [ -> ]
(05-01-2012, 10:44 PM)Bennick Wrote: [ -> ]Can anyone help?

Do you know how to use callbacks?
Yessir, most of the different kinds anyway. Would it be some kind of repeating callback where whenever you spawn in the area it restarts the music? That sounds wrong just typing it lol.
Pages: 1 2