Is it safe to write only 1 condition in branching?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Maltakreuz
Posts: 40
Joined: Sat Jul 25, 2015 2:36 pm

Is it safe to write only 1 condition in branching?

Post by Maltakreuz »

For example i have branching in dialogue, if player has 100 coins or not. So i have 1 node with to linked subnodes.

Image

On the first yes-node in Condition field i write:

Code: Select all

GetPartyCoins() >= 100
(GetPartyCoins() is my registered lua-function)

My question: is it safe to leave the Condition on the second node empty? It seems to work, but i am somehow unsure and i did not found anything about this in Conditions-page in docs.

Do i need to explicitly write on the second "no-node":

Code: Select all

GetPartyCoins() < 100
It would be great if i should not :3

Does it works for 3+ nodes too?
User avatar
Tony Li
Posts: 21981
Joined: Thu Jul 18, 2013 1:27 pm

Re: Is it safe to write only 1 condition in branching?

Post by Tony Li »

It's safe.

You can specify the order of the nodes by inspecting the parent node. The order is shown in the parent node's "Links To:" section.

When the parent node evaluates its links, it will make a list of all nodes whose Conditions are true or blank, in the order specified by the "Links To:" section. If any of these are assigned to an NPC actor, it will use the first node in the list.

If the "GetPartyCoins() >= 100" is false, then that node will not be in the list, so the conversation will use the next node in the list.

There is one exception: If your links have different priority values (e.g., AboveNormal, BelowNormal, etc.), then it will first check only the links at the highest priority level. If any of those links are true, it will stop there. Otherwise it will check the next priority level, etc.

Side note: It looks like you may have a broken folder in your project. The folder 'Editor Default Resources' is a special Unity folder. It must be in the root Assets folder. It should not be moved or renamed. The same is true for the Gizmos folder.
Maltakreuz
Posts: 40
Joined: Sat Jul 25, 2015 2:36 pm

Re: Is it safe to write only 1 condition in branching?

Post by Maltakreuz »

Thank you for explanation! So i can just leave in such cases second "no-node" blank and it safe to make so. That's convenient.
User avatar
Tony Li
Posts: 21981
Joined: Thu Jul 18, 2013 1:27 pm

Re: Is it safe to write only 1 condition in branching?

Post by Tony Li »

Glad to help! :-)
Post Reply