Gamestudio Links
Zorro Links
Newest Posts
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
Data from CSV not parsed correctly
by EternallyCurious. 04/25/24 10:20
Trading Journey
by howardR. 04/24/24 20:04
M1 Oversampling
by Petra. 04/24/24 10:34
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (EternallyCurious, AndrewAMD, TipmyPip, Quad), 889 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
the media_tune won't tune #155786
09/20/07 19:57
09/20/07 19:57
Joined: Jan 2007
Posts: 110
USA East Coast
K
KojaK Offline OP
Member
KojaK  Offline OP
Member
K

Joined: Jan 2007
Posts: 110
USA East Coast
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);
}
}
}





Last edited by KojaK; 09/20/07 20:01.
Re: the media_tune won't tune [Re: KojaK] #155787
09/22/07 14:28
09/22/07 14:28
Joined: Jan 2007
Posts: 110
USA East Coast
K
KojaK Offline OP
Member
KojaK  Offline OP
Member
K

Joined: Jan 2007
Posts: 110
USA East Coast
Can someone help?


Lead programmer for Two Screws Loose Click here for our forums, and downloads for our games
Re: the media_tune won't tune [Re: KojaK] #155788
09/22/07 19:20
09/22/07 19:20
Joined: Jul 2007
Posts: 959
nl
F
flits Offline
User
flits  Offline
User
F

Joined: Jul 2007
Posts: 959
nl
dont use temp but a var
and this much be changed
temp.y = clamp(temp.y, music_volume,0);
.y ore .x


"empty"
Re: the media_tune won't tune [Re: flits] #155789
09/24/07 19:40
09/24/07 19:40
Joined: Jan 2007
Posts: 110
USA East Coast
K
KojaK Offline OP
Member
KojaK  Offline OP
Member
K

Joined: Jan 2007
Posts: 110
USA East Coast
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?

Last edited by KojaK; 09/24/07 19:42.

Lead programmer for Two Screws Loose Click here for our forums, and downloads for our games
Re: the media_tune won't tune [Re: KojaK] #155790
09/24/07 20:52
09/24/07 20:52
Joined: Jul 2007
Posts: 959
nl
F
flits Offline
User
flits  Offline
User
F

Joined: Jul 2007
Posts: 959
nl
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


"empty"
Re: the media_tune won't tune [Re: flits] #155791
09/25/07 20:16
09/25/07 20:16
Joined: Jan 2007
Posts: 110
USA East Coast
K
KojaK Offline OP
Member
KojaK  Offline OP
Member
K

Joined: Jan 2007
Posts: 110
USA East Coast
music_volume is a global variable that can only be set at runtime, and by a slider on the music options menu.


Lead programmer for Two Screws Loose Click here for our forums, and downloads for our games
Re: the media_tune won't tune [Re: KojaK] #155792
09/26/07 19:47
09/26/07 19:47
Joined: Jan 2007
Posts: 110
USA East Coast
K
KojaK Offline OP
Member
KojaK  Offline OP
Member
K

Joined: Jan 2007
Posts: 110
USA East Coast
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.


Lead programmer for Two Screws Loose Click here for our forums, and downloads for our games
Re: the media_tune won't tune [Re: KojaK] #155793
09/26/07 19:49
09/26/07 19:49
Joined: Jul 2007
Posts: 959
nl
F
flits Offline
User
flits  Offline
User
F

Joined: Jul 2007
Posts: 959
nl
pfff said that 2 times


"empty"
Re: the media_tune won't tune [Re: flits] #456332
11/19/15 07:48
11/19/15 07:48
Joined: Dec 2010
Posts: 224
NRW, Germany
NeoJones Offline
Member
NeoJones  Offline
Member

Joined: Dec 2010
Posts: 224
NRW, Germany
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

Last edited by NeoJones; 11/19/15 07:51.

Errors are the engine of progress.

Version: A8 Commercial
OS: Win 7 64bit
Models: Cinema 4D

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1