Forum rules - please read before posting.

Change Speech folder

Hi,

1. Is there a way to change the Speech folder (root or structure)? E.g:  “MyGame01/Resources/MyFolder/”


2. How can I dynamically change the Speech folder path when the game starts?  I want to be able to decide which Speech folder the game should use.  E.g: set a global variable (string) which will hold the path of the Speech folder.


(I know there’s a Language root\folders which I can set, but this is not what I need)


Thanks,

Adam






Comments

  • Welcome to the community, @adamsen.

    The "Resources/Speech" folder is hardcoded - but if your game supports translateable audio, then non-original audio files are placed in subfolders within, e.g.:

    Resources/Speech/French/...
    Resources/Speech/German/...

    If it suits your game, you could consider making each set of speech a different language.  That way, you could switch audio files simply by changing the game's current language.

    Otherwise, I can consider exposing the "Speech" folder name as a Manager property - but let me know if the above is suitable first.
  • Thanks Chris, it’s great working with AC!

    First, I would like to say that I think the Speech aspect is well handled and it works great.

    The reason I’m writing here is that I have an “unorthodox” structure\game, so I need an extra flexibility.

    I’m trying to achieve two things:

    1. To be able to change the root folder of the Speech without predefining it in the manager.

    2. To be able to define any root. Like: “MyFolder/Resources/folder/”  - (in other words: I want to arrange the folders structure according to my logic )


    Example of a use-case:

    I want to create a global ‘String’ variable and set it with a certain value (“MyFolder/Resources/folder/”), and whenever I need, I could use this value to change the Speech root of the game. (I’ll be responsible to make sure that the non-original audio files are in this given path).







  • When speech audio is automatically pulled via filename, it does so using Unity's Resources.Load method - which doesn't allow for control over the origin of the Resources folder.  So:

    MyFolderA/Resources/
    MyFolderB/Resources/

    Are both searched for assets with the supplied filename.  The location of the Resources folder(s) is ignored.

    The only way you can specify what files are found is rely on subfolders within Resources.  The method above using languages allows for that - have you tried it?

    Exposing the "Speech" folder name in the Manager would allow control over it through scripting.  Any Manager field can be modified at runtime - you can right-click a field's label to get an API reference to it.
  • Hi Chirs,

    Thanks for your answer.

    Regarding: “The only way you can specify what files are found is rely on subfolders within Resources.”

    So in that case, I would arrange my files in subfolders within Resources:

    Resources/Speech/01/A/…

    Resources/Speech/01/B/…

    Resources/Speech/02/A/…

    I’ve tried using languages, but it limits me in a way that I need to predefine it. And I have a Non-AC scene which sometimes generates new folders with audio files at runtime. so I can't use it.

     

    Regarding:  “Exposing the "Speech" folder name in the Manager would allow control over it through scripting

    Great! I don’t mine to use scripting – I could create a script that will set the right folder at runtime.


    Thanks,

  • All right - consider it in for the next release.
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.