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"

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;
                         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!


Product Version: UE 4.10
more ▼

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

avatar image

6.7k 330 184 464

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

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

64 2 12 68

(comments are locked)
10|2000 characters needed characters left
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