Page 1 of 1
Sequencer Command To Check Outgoing Links
Posted: Mon Dec 23, 2024 5:28 am
by albuarki
Hi, I'm trying to figure out a way to have a sequencer command to check possible dialogue entries to play, chooses the best one to play and then play it.

- Example
- Screenshot 2024-12-23 at 1.01.52 PM.png (133.43 KiB) Viewed 751 times
In this example, the nodes from START and from A, B and C hold should hold the sequencer commands. The first one from START should check the NPC lines to choose from, if the entries conditions have passed, then it is considered and out of the passed entries, the entry with the highest number of variables gets picked.
Similarly, the same is applied for the second sequencer command, it checks the player choices with the same logic, however it will show up to 4 options that have passed (or available) and block the remaining ones.
I'm just wondering if something like this is possible and if sequencer commands are suitable for this.
Thank you.
Re: Sequencer Command To Check Outgoing Links
Posted: Mon Dec 23, 2024 9:23 am
by Tony Li
Hi,
While you could use a sequencer command or a
regular C# method that you've registered with Lua, it's probably easiest to use neither. Instead, use an
OnConversationLine(Subtitle) method.
Also, I don't recommend changing the <START> node. Leave it untouched.
In your OnConversationLine method, adjust DialogueManager.currentConversationState.npcResponses or pcResponses. For example, to handle the first case, I set the <> node's Title to "test1". Then I added a script with the method below to the Dialogue Manager. I'm not sure what you mean by the "highest number of variables", so I just went with the node whose Conditions string is longest in this example:
Code: Select all
public void OnConversationLine(Subtitle subtitle)
{
if (subtitle.dialogueEntry.Title == "test")
{
var responses = DialogueManager.currentConversationState.npcResponses;
var longestResponse = responses[0]; // Assumes we have 1+ NPC responses.
for (int i = 1; i < responses.Length; i++)
{
if (responses[i].destinationEntry.conditionsString.Length >
longestResponse.destinationEntry.conditionsString.Length)
{
longestResponse = responses[i];
}
}
DialogueManager.currentConversationState.npcResponses = new Response[] { longestResponse };
}
}
You can use a similar approach to set DialogueManager.currentConversationState.pcResponses in the second case you asked about.
Re: Sequencer Command To Check Outgoing Links
Posted: Mon Dec 23, 2024 9:48 am
by albuarki
Hi Tony,
Thank you for your response.
Just to clarify, highest number of variables means the actual count of variables.
Basically the idea is that a line that passes with 3 variables that are true is more relevant than an option with only 1 variable as a condition.
This would give a relevant dialogue reflecting the current game state. That’s why the suggestion to use a sequencer command was to be able to trigger it whenever the writers feel appropriate.
Thanks again.
Re: Sequencer Command To Check Outgoing Links
Posted: Mon Dec 23, 2024 9:50 am
by Tony Li
Hi,
You could manage to do it with a sequencer command somehow, but it'll be easier with an OnConversationLine. You can ask your writers to add a string like "Check NPC Nodes" in the Title to tell the OnConversationLine method to check the NPC nodes' and "Check PC Nodes" in the Title to check the PC nodes using your alternate logic for PC nodes.
Re: Sequencer Command To Check Outgoing Links
Posted: Mon Dec 23, 2024 10:00 am
by albuarki
That helps a lot, thank you!
Re: Sequencer Command To Check Outgoing Links
Posted: Mon Dec 23, 2024 2:01 pm
by albuarki
Tony Li wrote: ↑Mon Dec 23, 2024 9:50 am
Hi,
You could manage to do it with a sequencer command somehow, but it'll be easier with an OnConversationLine. You can ask your writers to add a string like "Check NPC Nodes" in the Title to tell the OnConversationLine method to check the NPC nodes' and "Check PC Nodes" in the Title to check the PC nodes using your alternate logic for PC nodes.
I just tested this and it works great, much better than using sequencer commands. Just wondering, is there a way to set the titles in Articy Draft? I tried an empty dialogue fragment and it came out as: PickNPC: "..."
Re: Sequencer Command To Check Outgoing Links
Posted: Mon Dec 23, 2024 2:18 pm
by Tony Li
Hi,
Yes, in articy:draft just add a custom property named "Title" to your dialogue fragment template.