How do I decide which Conversation to start when clicking on an NPC?
I'm making an Action/Adventure sort of game, where the player can run around and talk to NPCs. When the player clicks on an NPC, I want to initiate a conversation. The data for the conversation is stored in a ScriptableObject, and consists of a list of Lines, which contain an audio clip and the dialog text.
How do I decide which conversation to initialize, based on the NPC that was clicked, and perhaps some other parameters?
I've got an event system set up, but I just can't seem to figure out how to specify the exact conversation to initiate!
If you want to see any specific parts of my code, let me know. There's just too much for me to put it all here.
I know there's systems for sale on the asset store but I'd like to script my own.
Any help would be greatly appreciated!
As usual, I found a solution to my problem shortly after posting it :/
I've passed in the names of my characters and a conversation index as a conversationName when I start the conversation, and then use
ConversationData conversationData = Resources.Load("Data/ConversationData/" + conversationName) as ConversationData;
to load the data.
Your answer
Follow this Question
Related Questions
Camera-movement within another camera 1 Answer
How can i make an Dialogue for an NPC 0 Answers
How to continue dialog automatically (without pressing buttons)? 1 Answer
NPC Dialog 1 Answer
Errors on Script? 1 Answer