Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Shelf | Store

Privacy Policy


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SOLVED] Lantern oil and Music
Author Message
Zirg Offline
Junior Member

Posts: 14
Joined: Feb 2011
Reputation: 0
Post: #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 all posts by this user Quote this message in a reply
junkfood2121 Offline
Senior Member

Posts: 267
Joined: Jan 2011
Reputation: 3
Post: #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);

May I present to you.. the Grunt Cannon:
http://www.youtube.com/watch?v=v9KjvvVzNNg
(This post was last modified: 02-26-2011 06:10 PM by junkfood2121.)
02-26-2011 06:10 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Zirg Offline
Junior Member

Posts: 14
Joined: Feb 2011
Reputation: 0
Post: #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 all posts by this user Quote this message in a reply
nkmol Offline
Senior Member

Posts: 252
Joined: Feb 2011
Reputation: 4
Post: #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 all posts by this user Quote this message in a reply
junkfood2121 Offline
Senior Member

Posts: 267
Joined: Jan 2011
Reputation: 3
Post: #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.

May I present to you.. the Grunt Cannon:
http://www.youtube.com/watch?v=v9KjvvVzNNg
02-26-2011 07:44 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)