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
[SOLVED] Lantern oil and Music
Zirg Offline
Junior Member

Posts: 14
Threads: 4
Joined: Feb 2011
Reputation: 0
#1
[SOLVED] Lantern oil and Music

EDIT*
About the music part.
As long as I don't put StopMusic in the callback function, the music that was playing before the areamusic kicked in, continues automatically after the areamusic has stopped playing. Thanks everyone who put time in trying to figure this out for me.


My first question involves the amount of oil, when you first pick up the lantern.

Is there a script that sets the amount of oil to less than 100% when you first pick it up? What I mean is, when you find the lantern, it's only half full.

My second question involves music in my custom story.

I have set this in my script:

void OnStart()
        
{  
PlayMusic("12_amb.ogg", true, 1, 4, 0, true);
}

Now, is it possible for this music to resume, after I've hit a CollideCallback area that plays a specific musicfile that doesn't loop?

So to illustrate it:

- I start my level and 12_amb.ogg starts to play
- I walk inside a room, hit a collidearea and insertoggfilehere.ogg starts to play
- insertoggfilehere.ogg finishes
- 12_amb.ogg needs to resume playing.
(This post was last modified: 02-26-2011, 07:31 PM by Zirg.)
02-26-2011, 06:07 PM
Find
Linus Ågren Offline
Senior Member

Posts: 309
Threads: 58
Joined: Jan 2011
Reputation: 5
#2
RE: Lantern oil and Music

For lamp oil, the syntax is:
SetPlayerLampOil(float afOil);

afOil = Oil amount

For a non-looping music, just change true to false:
PlayMusic("12_amb.ogg", false, 1, 4, 0, false);

Creator of The Dark Treasure.
(This post was last modified: 02-26-2011, 06:10 PM by Linus Ågren.)
02-26-2011, 06:10 PM
Website Find
Zirg Offline
Junior Member

Posts: 14
Threads: 4
Joined: Feb 2011
Reputation: 0
#3
RE: Lantern oil and Music

Thanks for the quick response,

Oil amount is perfect now, thanks.

The answer to the music isn't solved though, I've edited my original post so it maybe is a bit clearer on what I mean.

What I meant was: 12_amb.ogg needs to resume playing, as soon as insertoggfilehere.ogg has finished.
What happens now is; as soon as I hit the area, 12_amb.ogg stops playing (which is good) then insertoggfilehere.ogg starts to play (i only need it to play once so thats good too) but then everything goes silent.
What I want to happen is that 12_amb.ogg continues playing after insertoggfilehere.ogg has finished.
02-26-2011, 06:37 PM
Find
nkmol Offline
Senior Member

Posts: 252
Threads: 19
Joined: Feb 2011
Reputation: 4
#4
RE: Lantern oil and Music

maybe try something whith FadeGlobalSoundVolume(float afDestVolume, float afTime);
to put the sound "12_amb.ogg" to 0 and after the other sound is gone, set it back to like 1 (u could use a timer for that).

i haven't experimented whith this, though
sorry just a suggestion Tongue
(This post was last modified: 02-26-2011, 07:26 PM by nkmol.)
02-26-2011, 07:19 PM
Find
Linus Ågren Offline
Senior Member

Posts: 309
Threads: 58
Joined: Jan 2011
Reputation: 5
#5
RE: [SOLVED] Lantern oil and Music

Hmm.. That's odd.

Start Music for me:
PlayMusic("06_amb.ogg", true, 1, 3, 0, true);

I have this in a script:
PlayMusic("01_event_critters.ogg", false, 1, 0, 10, false);

And it makes the music start after the one above finished playing.
Try changing the numbers to 1, 0, 10. I'm not sure tho.

Creator of The Dark Treasure.
02-26-2011, 07:44 PM
Website Find




Users browsing this thread: 1 Guest(s)