x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Best place to "load" AudioVolumeSettings?

Hey there,

I'm currently working on a Settings Menu for the Main Menu and In-Game Menu.

For the AudioVolume, I created 3 SoundClasses, 1 Parent Class and 2 Children. When setting the AudioSettings in my Settings Menu, I use the UGameUserSettings Class, of which I have a Child with an overridden ApplySettings(..) function.

It iterates through the AudioDevice SoundClasses and applies the Values based on their names:

 void UBMGameUserSettings::ApplyAudioSettings()
 {
     if (GEngine)
     {
         FAudioDevice* ADevice = GEngine->GetMainAudioDevice();
 
         if (ADevice)
         {
             for (auto Itr = ADevice->SoundClasses.CreateIterator(); Itr; ++Itr)
             {
                 USoundClass* SoundClass = Itr.Key();
 
                 FString SoundClassName;
 
                 if (SoundClass->GetFullName().Split(L".", nullptr, &SoundClassName, ESearchCase::CaseSensitive))
                 {
                     // Set one of the twoClasses
                     if (SoundClassName == "BMSoundClass_Music")
                     {
                         SoundClass->Properties.Volume = MusicSoundVolume;
                     }
                     else if (SoundClassName == "BMSoundClass_SFX")
                     {
                         SoundClass->Properties.Volume = SFXSoundVolume;
                     }
                     else
                     {
                         SoundClass->Properties.Volume = GlobalSoundVolume;
                     }
                 }
             }
         }
     }
 }


This is all working fine. The Float Numbers are saved in the GameUserSettings.ini and are correctly loaded back into the Menu when reopening it. But now I face the problem of actually applying the Settings on Startup. Because right now, I need to press "ApplySettings" again to apply the SoundVolume again. While the Numbers are saved and loaded, the "Applying" is missing.

It tried calling the ApplyAudioSettings function on LoadSettings of the GameUserSettings class, but that seems to happen WAY too early, so the SoundClasses aren't yet spawned.

This setting needs to be applied to all SoundClasses. The ones of the MainMenu and every following Level.

What's the best place to call that, so it's called at the correct time, every time a new Level is opened?

If you need more information, just tell me. Thanks in advance!

Cheers!

Product Version: UE 4.10
Tags:
more ▼

asked Apr 24 '16 at 05:50 PM in C++ Programming

avatar image

eXi
6.8k 333 185 468

avatar image eXi Apr 29 '16 at 11:54 AM

4 days have passed, so I bump this question (: Still haven't found a good place to load SoundClass Settings!

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

You should inherit from UGameUserSettings. There you can place additional properties like MasterSoundVolume and store them.

Also look at this question: https://answers.unrealengine.com/questions/293038/how-to-store-variables-to-a-custom-ini-file.html

more ▼

answered Aug 05 '16 at 12:33 PM

avatar image

_maja_
64 3 13 68

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question