Page 1 of 1

Use conditions through C#

Posted: Sat Jul 30, 2022 12:54 pm
by forrestuv
Hi,
I prefer to drive conversations using StandardDialogueUI inherited class, since I don't wanna use LUA variables and conditions.
I would just need to disable a branch/link upon an internal condition before stepping to next node
What's the best way to do this in C#?
(I've already managed to override ShowSubtitle(), ShowResponses() being able to disable certain responses)

thx

Re: Use conditions through C#

Posted: Sat Jul 30, 2022 2:36 pm
by Tony Li
Hi,

Assign a delegate to DialogueManager.isDialogueEntryValid. Example:

Code: Select all

DialogueManager.isDialogueEntryValid = CheckMyCSharpConditions;
...
bool CheckMyCSharpConditions(DialogueEntry entry)
{
    // If  entry's C# conditions are valid right now, return true. Otherwise return false.
}