Page 1 of 1

Change condition priorities with C#

Posted: Thu Jun 22, 2023 4:23 am
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;

Re: Change condition priorities with C#

Posted: Thu Jun 22, 2023 5:01 am
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 :)

Re: Change condition priorities with C#

Posted: Thu Jun 22, 2023 8:47 am
by Tony Li
*quack* ;)