As titled,
For reasons I won't go into I need to be able to do this, so for example if player does X I want a conversation trigger to be set to ConvX if they do Y I want the trigger to be set to ConvY. Now I could do this with a load of conversation triggers and various variables, but that is really messy. I have the same trigger I need to reassign to multiple times.
Thanks.
Can I directly change the conversation of a conversation trigger using the dll version?
-
- Posts: 91
- Joined: Tue Jul 14, 2015 8:22 am
Re: Can I directly change the conversation of a conversation trigger using the dll version?
Hi,
If I understand you correctly, you want to change the conversation assigned to a Conversation Trigger at runtime. If so, it's pretty easy. I don't know why I've recently developed a habit of always providing two options -- but, well, here are two options.
1. In a script, set the ConversationTrigger's conversation property. It's a string:
2. Or have it always trigger the same conversation (e.g., titled "Entry Conversation") but, in the conversation, use cross-conversation links to conversations ConvX and ConvY based on a Lua variable value. To add a cross-conversation link, inspect a node (such as the START node). In the inspector, click on the "(Link To)" dropdown. Select "(Another Conversation)". You can't link to another conversation's START node; this is a limitation imposed by the Chat Mapper data structure. So you'll have to link to a child node. It might look something like this:
Entry Conversation
If I understand you correctly, you want to change the conversation assigned to a Conversation Trigger at runtime. If so, it's pretty easy. I don't know why I've recently developed a habit of always providing two options -- but, well, here are two options.
1. In a script, set the ConversationTrigger's conversation property. It's a string:
Code: Select all
ConversationTrigger convTrig = ??? // Assign this whatever way works best for you.
ConversationTrigger convTrig = FindObjectOfType<PixelCrushers.DialogueSystem.ConversationTrigger>(); //... like this for example.
convTrig.conversation = "ConvX";
Entry Conversation
- START:
Link to: ConvX.Entry
Link to: ConvY.Entry
- START
- Entry: NPC: "I hear you did X." {Conditions: Variable["playerDid"]=="X"}
- PC: "So? I like to X."
- Entry: NPC: "I hear you did X." {Conditions: Variable["playerDid"]=="X"}
- START
- Entry: NPC: "So, you did Y, eh?" {Conditions: Variable["playerDid"]=="Y"}
- PC: "Yup, you got me. I did Y."
- Entry: NPC: "So, you did Y, eh?" {Conditions: Variable["playerDid"]=="Y"}
-
- Posts: 91
- Joined: Tue Jul 14, 2015 8:22 am
Re: Can I directly change the conversation of a conversation trigger using the dll version?
Thanks for the help Tony, no idea how I missed this totally obvious solution. Must be tired.