Frictional Games Forum (read-only)
[SOLVED] Lantern oil and Music - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods (https://www.frictionalgames.com/forum/forum-35.html)
+--- Thread: [SOLVED] Lantern oil and Music (/thread-6725.html)



[SOLVED] Lantern oil and Music - Zirg - 02-26-2011

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:

Code:
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.


RE: Lantern oil and Music - Linus Ågren - 02-26-2011

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);


RE: Lantern oil and Music - Zirg - 02-26-2011

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.


RE: Lantern oil and Music - nkmol - 02-26-2011

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


RE: [SOLVED] Lantern oil and Music - Linus Ågren - 02-26-2011

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.