SetCVar

Moderator: GZDoom Developers

User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post by HotWax »

TheDarkArchon wrote:
David Ferstat wrote: If a mapper has gone to the trouble of selecting specific music, and determining specific circumstances where this music should fade in or out, or change to a different music track, then it's the player's loss if he/she ignores this.
If fades mean setting the volume, the player can have a nasty jumping if the volume suddenly goes on.
"Fade" could easily mean having two very simple ACS commands:

Code: Select all

FadeOut(float seconds)

Lowers the volume of the music to 0 over the amount of seconds specified.

FadeIn(str music, float seconds)

Disables the music (if any) and fades in the specified music track over the amount of seconds specified.  If seconds is < 1.0, it is assumed to be 1.0.
No jumping, and no overriding the user's set volume. Happy?
User avatar
edward850
Posts: 5889
Joined: Tue Jul 19, 2005 9:06 pm
Location: New Zealand
Contact:

Post by edward850 »

I would like it, but it should be like this...

Code: Select all

Fadeout(float seconds, int players);
Fadein(float seconds, int players, str music);

Seconds = amount of seconds to fad in or out
Players = 0 to affect the player who activated the script or 1 to affect every player
Music = the music to be set, if blank, don’t change the music
User avatar
Bio Hazard
Posts: 4019
Joined: Fri Aug 15, 2003 8:15 pm
Location: ferret ~/C/ZDL $
Contact:

Post by Bio Hazard »

Why not have a destination volume? That way you could have the music get a bit quieter when someone is talking (with voiceover) and then you can raise it back up to wherever it was.

If you did that, there would be no need for 2 seperate fading functions.

FadeMusic(float target,float seconds,int players);

Code: Select all

FadeMusic(0.5,1.0,0); // fade music to 50% of the user's music setting
delay(35);
ambientsoundid("talk1",128,1);
soundwait(1);
FadeMusic(1.0,1.0); // fade music to 100% of the user's music setting

Code: Select all

// Fade music out, change the song and fade it in.
FadeMusic(1.0,5.0,1);
SetMusic("newsong");
FadeMusic(1.0,5.0,1);
Last edited by Bio Hazard on Sat Oct 21, 2006 1:29 am, edited 4 times in total.
User avatar
edward850
Posts: 5889
Joined: Tue Jul 19, 2005 9:06 pm
Location: New Zealand
Contact:

Post by edward850 »

you mean like this, I love it...

Code: Select all

Musicfade(float seconds, float destination, int players, str music);

Seconds = amount of seconds to fad in or out
Destination = the final point of music fadeing (0.0 being muted, 1.0 being full)
Players = 0 to affect the player who activated the script or 1 to affect every player
Music = the music to be set, if blank, don’t change the music
[/quote]
User avatar
Risen
Posts: 5263
Joined: Thu Jan 08, 2004 1:02 pm
Location: N44°30' W073°05'

Post by Risen »

Volume controls should be implemented on a separate control than those the user can change. If the user's master is set to 50%, then an ACS volume setting of 50% is actually 25%. Programs should never be allowed to exceed a user's set volume, and should accept it as normal.
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post by HotWax »

Bio's solution seems to be the best suggestion so far. Graf, do you want to comment on it here or should we create a new thread for it?
User avatar
Bio Hazard
Posts: 4019
Joined: Fri Aug 15, 2003 8:15 pm
Location: ferret ~/C/ZDL $
Contact:

Post by Bio Hazard »

Really I'd rather do int tics for time instead of float seconds, but float seconds seems to be the norm for these types of functions.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49230
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

All the internal mechanisms for music fading are already there - except the maintenance of this state. It simply needs a little time to implement but that's the one thing I haven't had recently.
User avatar
edward850
Posts: 5889
Joined: Tue Jul 19, 2005 9:06 pm
Location: New Zealand
Contact:

Post by edward850 »

So does this mean its in?
if so, how will the comand work?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49230
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

No, it's not in. The only thing that's in is some functions that can set such a volume scaling factor.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”