the media_tune won't tune

Posted By: KojaK

the media_tune won't tune - 09/20/07 19:57

I would like a fade-in & fade-out for my music. It is designed to fade in if the enemies can see you, and then stop where it was and fade back out if they can't see you anymore. Unfortunately, it's not working. This is how it works: (by the way, I typed this from memory)

Code:

while(player.health > 0{
temp.x = clamp(temp.x, 0, music_volume);
temp.y = clamp(temp.y, 0, music_volume);
if(player.seen == true){
temp.x -= 1;
temp.y += 1;
media_tune(slow, music_volume-temp.x, 0,0);
media_tune(fast, music_volume-temp.y, 0,0);
}
else{
if(player.seen == false){
temp.x += 1;
temp.y -= 1;
media_tune(slow, music_volume-temp.x, 0,0);
media_tune(fast, music_volume-temp.y, 0,0);
}
}
}




this doesn't work either:
Code:
 
temp.x = 0;
while(temp.x < music_volume){
temp.x += 1;
media_tune(music, music_volume-temp.x, 0, 0);
wait(1);
}



however, if I remove the fade, it works!

Code:

while(player.health > 0{
if(player.seen == true){
media_tune(fast, 1, 0,0);
media_tune(slow, music_volume, 0,0);
}
else{
if(player.seen == false){
media_tune(slow, 1, 0,0);
media_tune(fast, music_volume, 0,0);
}
}
}




Posted By: KojaK

Re: the media_tune won't tune - 09/22/07 14:28

Can someone help?
Posted By: flits

Re: the media_tune won't tune - 09/22/07 19:20

dont use temp but a var
and this much be changed
temp.y = clamp(temp.y, music_volume,0);
.y ore .x
Posted By: KojaK

Re: the media_tune won't tune - 09/24/07 19:40

I tried that. It produced wierd results, the sound was flickering off and on at weird times, and stuttering like crazy.

Oh, and if it matters, the enemies are always setting the player's seen flag to on.

Variables have always given me strange results, and since every function gets a temp.x y & z, why waste computing power storing a new one?
Posted By: flits

Re: the media_tune won't tune - 09/24/07 20:52

because temp is getting used almost more times in a game and eevery wait its changed

temp.y = clamp(temp.y, 0, 100);
if(music_volume == 0)
because temp.x = clamp(temp.x, 0, music_volume = (0);
and what is your code for music_volume because i dont see that maby thats the problem

uhm i dont know wat i said now but maby there is somthing that helps
Posted By: KojaK

Re: the media_tune won't tune - 09/25/07 20:16

music_volume is a global variable that can only be set at runtime, and by a slider on the music options menu.
Posted By: KojaK

Re: the media_tune won't tune - 09/26/07 19:47

Sorry everyone. I realized that temp is a global vector.

I fixed it replacing temp.x with fast_vol and temp.y with slow_vol.
Posted By: flits

Re: the media_tune won't tune - 09/26/07 19:49

pfff said that 2 times
Posted By: NeoJones

Re: the media_tune won't tune - 11/19/15 07:48

Hi,
I play a .wmv file with media_play, but if I use media_tune, than my movie dont playing and paused. It shows me the first frame of the movie and stopped.
Has anyone an idea?

Regards, NJ

Edit: Oh sorry, wrong forum xD
© 2024 lite-C Forums