Change condition priorities with C#

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
thecodehermit
Posts: 41
Joined: Mon Jul 19, 2021 11:27 am

Change condition priorities with C#

Post by thecodehermit »

Hi,
I want to change the condition priorities on a node with C#.

What I am trying to do is:

1- Somehow assign this variable with the DialogueEntry for node 1.

Code: Select all

DialogueEntry parent_Respond_BTN = ??? ;
2- Once it is assigned I access its Link list

Code: Select all

List<Link> responses_Links
3- Then I do something like this to change a specific link priority

Code: Select all

 DialogueManager.masterDatabase.GetDialogueEntry(responses_Links[2]).conditionPriority = ConditionPriority.High;
Currently changing the priority does nothing. I suspect it is because I have a copy and not the actual connection with the node data. So I am changing the copy instead of the real deal.

EDIT:
I also tried this, but it still doesn't work. I am not quite sure if this is the right approach to begin with..

Code: Select all

        
        DialogueEntry  parent_Respond_BTN = DialogueManager.masterDatabase.GetDialogueEntry(12, 6);

        parent_Respond_BTN.outgoingLinks[2].priority = ConditionPriority.High;
        parent_Respond_BTN.outgoingLinks[3].priority = ConditionPriority.High;
thecodehermit
Posts: 41
Joined: Mon Jul 19, 2021 11:27 am

Re: Change condition priorities with C#

Post by thecodehermit »

Oh my god...... there was an extra comma at my conditions string... I removed it and now everything works. It's like I had a couple of bolts stuck somewhere in the gear mechanism -_-
Anyway thank you for serving as a rubber duck again :)
User avatar
Tony Li
Posts: 22125
Joined: Thu Jul 18, 2013 1:27 pm

Re: Change condition priorities with C#

Post by Tony Li »

*quack* ;)
Post Reply