Wintermute Engine Forum

Wintermute Engine => Technical forum => Topic started by: TheDerman on November 08, 2011, 02:57:40 PM

Title: Volume help please
Post by: TheDerman on November 08, 2011, 02:57:40 PM
Hey,

I'm really having some trouble figuring out a volume issue - I want to increase and decrease the volume of music at certain points in the game - I'm setting the globalmusicvolume - but this is causing problems since it puts it in the registry - basically if I set it to 100 at a certain point in the game, then save the game, then reload an old savegame where the volume needs to be 55, then because it's a registry value, the volume becomes 100, rather than 55.

Any ideas how to overcome this to ensure the volume is correct at all time? I'm all out of ideas.  :(
Title: Re: Volume help please
Post by: anarchist on November 12, 2011, 09:52:57 AM
Isn't it possible to have a global variable like globalMusicVolume and read its value every time you load to set the volume? Something like:

Code: WME Script
  1. on "load"
  2. {
  3.   if(SelectedSlot >= 0) Game.LoadGame(SelectedSlot);
  4.   Game.SetMusicVolume(globalMusicVolume );
  5. }
  6.  
Title: Re: Volume help please
Post by: TheDerman on November 22, 2011, 09:18:26 PM
Thanks for the reply - I think I can use a separate registry value to solve the issue.  :)