Search the Community
Showing results for tags 'conversation'.
Found 1 result
I'm working on a solo project in Unity (C#), and I need to script something that will handle conversation between characters. Players won't be able to choose between dialogue options, and there's no UI, so basically all I need is to be able to manage a large number of sound assets in an organized way. Before diving in, I thought I'd ask if anyone here could offer any ideas. Previously, I had started managing conversation with a list of sound assets and a function that could be called to play one of them. So, there was a lot of "if (Time.time >= nextLine)" to determine when the next line of conversation should be played, etc. My Game Controller script was riddled with calls for lines of conversation... it was gross and confusing. Ideally, I want something that will store properties about each line of conversation (e.g., who is the speaker, what is said in the line, how long is the line, should the line be interruptible, should the line be repeatable, has the line already been said, what triggers the line), so that I can avoid having "SayDialogue (12);"s everywhere, and so that I can revise the sound assets and their properties in one location. Also, I'm thinking it might make sense to have a conversation queue, so that lines that are ready to be played stack up in there instead of interrupting each other. I don't have a formal CS background, so my main problem is that I don't know what my options are with designing this. I was thinking of trying to use an array to store the assets/properties and a list for the queue... Is there something else that I should also explore? Or am I overthinking this? Any tips or advice would be greatly appreciated. For reference, you can read my devdiary and/or play my latest build here. Thanks!