Forum rules - please read before posting.

Possible bug regarding dialogue scrolling sound

edited April 2017 in Engine development
Hello! I'm having the following problem regarding the scrolling sound: It works perfectly well in every starting scene, but as soon as I leave the scene, it stops working (no scrolling sound. The step sound functions ok, and so does the background).

the unity console displays de following message:

Cannot play text scroll audio clip as no 'Default' sound prefab has been defined in the Scene Manager

But every scene has its Default Sound prefab created, and as I said, the scrolling sound does work whenever I use the scene as the starter one. So either there is a bug, or there is some property I'm not setting correctly.

In the speech manager I have the scroll speech text ticked, and also, I have set the subtitle-scrolling audio and checked to have the audio play on every letter.

My version of AC is the following: 1.55a

Thanks in advance!!


PS: A little detail I was missing before. The Default Sound prefab, which is present in the hierarchy when in scene view and in the game when you start on that scene, dissappears when you enter from another scene (doesn't show as child of _Sounds and the warning mentioned above shows in the console).

Comments

  • edited April 2017
    Hi! and welcome to the Adventure Creator forums @jnrosenb!

    Anyway, ummm, is there any more information you can provide us? Like, what kind of Player or control type are you using? Is it a third person or first person? Some frameworks tend to expect the main audiosource to be inside the player in first person (I don't use first person much with AC though, so I can't recall). Do you have any other custom scripts in the scene? Anything that could be making an audiosource object a singleton(non destroyable) for example (in the singleton pattern the script destroys any duplicates it finds, so if it finds other audiosources it will destroy them). At this point any info about your project might be useful, cause there's not much to go about right now...
  • edited April 2017
    I'm making a simple 2d point and click, like the one in the official tutorial (I have been following that tutorial mostly for everything in the game)- I also have only one custom script, and it never messes with the Sound (it is only for displaying a data on a menu). 

    I will show pics of the inspector:

    So, at first I have the following scenario. In the scene, I have added a Sound prefab which is necesary according to an AC tutorial I read on this site to have the scrolling sounds working. 
    image

    Also, I have the player prefab setup with the clips that corresponds. He also has a sound child which is correctly assigned:
    image

    Then, in this scene, I hit play. Every sound works ok-. The dialogue, the steps, the background. The previously shown photos are still looking the same:
    imageimage

    But then I change scene, and when I come back, this happens:
    imageimage

    The dialogue sound is gone. The steps and background still play ok though (but that is understandable, since the players Sound child is still there. the one missing is the scene's Default Sound).

    Every time I talk to an npc, this message is displayed:
    image

    Finally, this is how I have set up my speech settings:
    image

    If you need more info please ask me. Thanks in advance!!
    EDIT** I'm trying to fix the images display, but they can still be seen if opened on a new tab!

  • edited April 2017
    I think I kind of fixed it. The Default Sounds in every scene had an ConstantID component. When removed, the dialogue sound started playing even if you came from another scene.
  • Good to hear it works now. Umm, by any chance did you duplicate that soundsource? it could be the ConstantID it had was clashing with another (if they both had the same ID). Generally, AC doesn't like having two objects with the same constantID.
  • This is occuring because you are referencing the Default Sound (a scene object) from your Player (an asset).  AC adds the Constant ID component as a way of creating a link between a scene object and an asset file, but any fields assigned in your Player Inspector should be present on the Player prefab itself as a child.

    The Speech AudioSource field is used for dialogue speech audio, not the scroll audio that plays when subtitles are shown.  Defining the Default Sound in your Scene Manager is enough - you don't need to assign it also to your Player.

    If you do want your Player to have speech audio, you need to add a new Sound object as a parent to your Player and assign it to the field - see the Demo game's Tin Pot player prefab for a practical example on how to do this.
  • Hi there, reviving thread.

    I updated to 1.70.4, and now, my new visited scenes (or loading the game to another scene for example), the scrolling text sound doesnt work. (But it work when I directly start in a scene)
    **
    "Cannot play text scroll audio clip as no 'Default' sound prefab has been defined in the Scene Manager"**

    I tried putting constant ID on the Default Sound, to no avail.

    My main Default Sound is parented to the Main Camera of each scene. Each Default Sound has been always assigned in the scene managers.

    My game doesn't use a "player". (I use a sort of Dummy Player object in order to not get performances issues because each cutscene trying to determine who is the player)

  • A Constant ID should not be necessary - the presence of a Default Sound, assigned in the Scene Manager as such, should be enough.

    What about Menu hover/click audio? These also get played from the Default Sound.

    I'll attempt a recreation.

  • I cannot reproduce any such error. Is the "Default Sound" field still assigned in the Scene Manager at runtime, and how are you switching scenes?

  • All sounds work except Scrolling text.

    I went to some of the scenes taking a look that the Default sound were assigned, adding the constant id just in case, resaving the scene (Like in previous AC updates that I had to resave the scene for something to be updated to the work, just to be sure). After re-reading the thread, removed the constant IDs again.

    If I jump in any scene the scrolling text sound works. But when changing doesn't work. That's why I revived this thread because was the same problem.

    I switch scenes preloading them, then switching, usually in the same Cutscene actionlist. (All default AC actions).

    It's the only problem after the Update, everything else looks fine.

    When I updated, the only thing I did was try to check that "cache camera.main" in the Settings, Press play. When changing scenes camera didn't worked so I guess that was not a parameter for me (I didn't check the documentation). I disabled that parameter, check the game again, and then is when I found the problem with the Scrolling text sound.

    Unity 2018.3.4

  • Just a consideration.

    ""Cannot play text scroll audio clip as no 'Default' sound prefab has been defined in the Scene Manager"**

    That sound objects needs to be a Prefab?

  • That doesn't seem to be a thing.

    After reading the manual, I just unassigned the default sound on a scene and hit the button to create a new one. That looked like a thing that should work.

    But it does not . Going to that scene either by a new game or either Loading a game, gives the same error.

  • edited February 2020

    That sound objects needs to be a Prefab?

    No, the error's wording is unclear. It should be a scene object.

    Again though: is the "Default Sound" field actually assigned at runtime, when the error shows?

    If all was working before, what version were you previously using?

    As a test, unparent the Sound object from the MainCamera in the first and second scenes - does that make any difference?

  • Yes, sorry, I can see the field assigned as usual in each scene in runtime while looking at the editor. I click the field and signals the default sound in the scene.

    I tried too unparenting from some cameras and check.

    I also tried making a prefab that survives scenes..... That didn't work either.

    I've been working in this project for a year, published since 5 months ago, never had that error showing before. My last working version was 1.69.4 since released; I was on that and next update in this project was directly 1.70.4, as I was waiting for a stable version.

    And as said, all other sounds works, Menu sounds, music, ambient, one shoots...

  • Other Menu sounds such as hover/click work?

    Try opening Dialog.cs, and insert the following into line 278:

    OnAwake ();
    

    Does that resolve the issue?

  • That fix it.

    What could have cause this?

  • I do not know - I still cannot recreate it. But I shall incorporate this change into the next release.

  • Fun fact, I just ran into this problem today, while attempting to port a game to the Nintendo Switch, and that line change fixed it as well. So it seems to exist in version... 1.70.4 while using Unity 2019.3.8f1

    Side note: While I did get the game to run on the 3DS, a while back, the amount of work rebuilding every scene was just far too much for me to handle part-time (it requires an old version of Unity and as we all know downgrading a project is pretty much impossible, in this case, the scenes load, but all logic is lost and has to be reentered and reconnected.). But the Switch? WOW, now this is some serious support. It works with the newest version of Unity and porting has been a breeze so far. "It just works!" Within an hour I played through my entire game on the switch, came across a total of 5 bugs, this being one of them, and have been slowly resolving them. Should have this ready in a month :)

  • v1.70.4 was still the latest release back then - the next release is taking a little longer than hoped to be finished, I'm afraid.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.