Forum rules - please read before posting.

Reusing the same speech id (or same file)

edited September 2019 in Technical Q&A

Not sure that this is possible, but here's what I'm trying to do:

I have ran a "gather text" and have added audio speech files to all the lines. Now what I want to do is to copy a Dialog:Speech action from one cutscene/interaction/asset to another. Same text should be shown and the same audio file should be used. But when I do this the ID isn't moved along with it. I tried changing the "ID number recycling" (which is now set to "Never recycle") to other values but it doesn't seem to help in this issue.

Thanks!

AC: 1.69.1
Unity: 2019.2.5

Comments

  • ID numbers are reset upon pasting an Action. You could feasibly prevent this by commenting out ActionSpeech's ClearIDs function, but this is present to avoid issues when re-gathering text again later.

    Instead, check Give matching speech lines the same ID? in the Speech Manager. If a line's speech text, and speaking character, matches another one - the two will share the same ID upon gathering.

  • Interesting idea, but if I'm reading you right, checking "Give matching speech lines the same ID" will make all short lines like the same player speaks, such as "Yes" and "No" share the same speech audio which shouldn't be the case..

    What I would love to do is to be able to this on specific actions. Like if the "Speeech Manager IDs" label was actually a textbox so I could override it by setting the id's myself where it applies.

  • I too would like this since I often need to reorder already recorded lines or move them into new action lists. Having a way to manually retain their IDs would be so helpful.
  • all short lines like the same player speaks, such as "Yes" and "No" share the same speech audio which shouldn't be the case..

    A line's ID is used to determine both translations and audio. If two lines share the same ID, then they should also have the same audio.

    Having a way to manually retain their IDs would be so helpful.

    ID numbers must be unique during the gather process - you'll get issues with lines changing / reset if you manually go and set a line's ID.

    Other than the modification above to ActionSpeech, or moving repeated lines into dedicated ActionLists, the only other way I can suggest is to have a separate speech Action type that only plays lines that are already gathered, i.e. you set a line ID (and possibly a character) and it does the rest.

  • I think there are two things we would love to see regarding this:

    1. The ability to move a bunch of speech actions from one list to another without the IDs changing
    Would it be possible to have the editor accept duplicate IDs (when copy/pasting speech actions), but have the Gather Text process throw an error if encountering duplicates, forcing us to remove them manually. This would make it super easy to refactor speech actions after the fact.

    2. The ability to reuse the same speech line in multiple places
    Moving them to a different action list is certainly an option that I never even considered, though not very convenient.

    A separate SpeechAction that only plays lines that are already gathered sounds like a great solution to me. As long as the original line text is also visible in the new action (though not editable). Maybe it could be a drop down list with all the IDs and line texts.

  • No, it really is too error-prone to have duplicate IDs be allowed.

    But here's such an Action to get around this:
    https://adventure-creator.fandom.com/wiki/Playing_speech_from_ID

    1. Perhaps the IDs could remain intact if the actions have been cut rather than copied (thus no duplicates could exist even in editor mode)? How else to move speech actions from one list to another after the fact?

    2. Your action looks interesting for sure, but the Line ID keeps reverting to 0 in-game. Also there's no way to specify the Speaker so it's all interpreted as narration :)

  • Perhaps the IDs could remain intact if the actions have been cut rather than copied (thus no duplicates could exist even in editor mode)?

    A fair suggestion, I will consider.

    Your action looks interesting for sure, but the Line ID keeps reverting to 0 in-game. Also there's no way to specify the Speaker so it's all interpreted as narration

    Speaker should be set automatically from the character's name. So long as their name is unique, and they're present in the scene, it should work. I cannot reproduce any line-reverting issue.

  • edited September 2019

    Speaker should be set automatically from the character's name. So long as their name is unique, and they're present in the scene, it should work. I cannot reproduce any line-reverting issue.

    When I tried it add a new instance of the action now (in a new list), the line that I set it to yesterday (in another list) was set, including the speaker. And when I try to change it in editor nothing happens - the old line id remains the same.

  • edited September 2019

    The contents of one Action shouldn't affect another. Try commenting out the AssignInteger function call.

    This is all just an example - it's a custom Action that's independent from AC. You can modify it to expose the speaker field in it's ShowGUI function if preferred.

  • Oh, sorry that was the remains of a hard coded test I forgot about yesterday...

    Here's the problem though: I add the a new instance of the action in the editor. Now if I change the Line ID from 0 to something else and tab away/click somewhere else to persist the number, then the number is reverted back to 0. But if I Alt+Tab away to another application, the number is persisted.

  • For performance, it uses a DelayedIntField, so you need to press Enter upon typing the number to set the value.

  • Ok :P
    UX aside, this little action solves issue #2 and is greatly appreciated!

  • UX aside

    You can replace it with IntField if you prefer.

    Perhaps the IDs could remain intact if the actions have been cut rather than copied (thus no duplicates could exist even in editor mode)?

    This is actually already the case if you cut Actions from within the Inspector. I shall allow the same from within the ActionList Editor.

  • You can replace it with IntField if you prefer.

    Much better :D

    This is actually already the case if you cut Actions from within the Inspector. I shall allow the same from within the ActionList Editor.

    That's great man!

  • Sorry to bring an old thread back to life again, but I noticed that EventManager.OnSpeechToken isn't fired when using the custom action you suggested:
    https://adventure-creator.fandom.com/wiki/Playing_speech_from_ID

    Thanks!

  • edited October 2019

    I can't see why it shouldn't. I'll attempt a recreation.

  • Oh, sorry - they do get fired. The reason I thought they were't is because I manipulate the
    KickStarter.speechManager.separateLinePause based on a custom "delay" token.

    This delay is ignored but I guess that it because technically, they are no longer separate lines. No worries, thanks!

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.