FMOD integration how to check if audio finished

Announcements, support questions, and discussion for the Dialogue System.
Saper
Posts: 85
Joined: Tue Jan 12, 2021 11:25 am

Re: FMOD integration how to check if audio finished

Post by Saper »

Hi Tony

But this will always shoot on start of the conversation even when conversation starts from "Node 1" not "Start node"?
Sytuation when SequenceEnd shoot two times:
- Conversation start from start, and SequenceEnd shot two times on Node 1
- After the response node, SequenceEnd shot two times in next Node (Continue() sequnece on respons node helps with that)
User avatar
Tony Li
Posts: 23251
Joined: Thu Jul 18, 2013 1:27 pm

Re: FMOD integration how to check if audio finished

Post by Tony Li »

You're correct. What if you instead use an OnConversationLine(Subtitle) method and check if subtitle.dialogueEntry.id == 0 (i.e., <START>)?
Saper
Posts: 85
Joined: Tue Jan 12, 2021 11:25 am

Re: FMOD integration how to check if audio finished

Post by Saper »

Hi Tony

OnConversationLine(Subtitle) don't fire on Start Node.
User avatar
Tony Li
Posts: 23251
Joined: Thu Jul 18, 2013 1:27 pm

Re: FMOD integration how to check if audio finished

Post by Tony Li »

Can you use OnConversationStart(Transform) instead then for the <START> node?
Saper
Posts: 85
Joined: Tue Jan 12, 2021 11:25 am

Re: FMOD integration how to check if audio finished

Post by Saper »

Hi Tony

Ok with OnConversationStart, I made it work properly. This is what i do:

- OnConversationStart i subscribe my own method
- My method gether info about node:

Code: Select all

        var _convID = DialogueManager.currentConversationState.subtitle.dialogueEntry.id;
        var _convActor = DialogueManager.currentConversationState.subtitle.dialogueEntry.ActorID;
- I check if node id 0 (for start node) and check actor ID (if response Actor ID)
- If one of this check is true I change my var "StartNode" to true
- OnSequenceEnd: If "StartNode is true then change value of "StartNode" to false, and do nothing
- If "StartNode" value is false set audio as finished

Also to automatize this also to response menu i do similar thing but on OnSequenceStart:
- I gether info about actor ID (for this i don't need node ID)
- check actor ID (if response Actor ID)
- If check is true I change my var "StartNode" to true
- OnSequenceEnd: If "StartNode is true then change value of "StartNode" to false, and do nothing
- OnSequenceEnd: If "StartNode" value is false set audio as finished

Thanks for all the help Tony I think we got this :)
User avatar
Tony Li
Posts: 23251
Joined: Thu Jul 18, 2013 1:27 pm

Re: FMOD integration how to check if audio finished

Post by Tony Li »

Glad you got it working!
Post Reply