Enable modding capabilities on database

Announcements, support questions, and discussion for the Dialogue System.
User avatar
Tony Li
Posts: 21681
Joined: Thu Jul 18, 2013 1:27 pm

Re: Enable modding capabilities on database

Post by Tony Li »

Alternatively, if players will be writing these Twine stories for modding, your code can check the first node linked from <START> after importing from Twine. If the node's text is blank, add "Continue()" to the Sequence:

Code: Select all

var start = conversation.GetFirstDialogueEntry();
var entry = conversation.GetDialogueEntry(start.outgoingLinks[0].destinationDialogueID);
if (string.IsNullOrEmpty(entry.DialogueText))
{
    entry.Sequence = $"Continue(); {entry.Sequence}";
}
BrightC
Posts: 7
Joined: Sat Jul 01, 2023 4:46 pm

Re: Enable modding capabilities on database

Post by BrightC »

I only got around to try it, but using Continue() works, thanks!
However, that made me realize this rabbit hole keeps going deeper and deeper. Though it must be nearing its end, I hope! With the current setup, I now need to check a condition before traversing a link. Putting it under Conditions: on the node below is not sufficient from what I can tell. So something like...

(if: CurrentQuestState("Quest 1") == "unassigned") [[Quest 1 Open]]
(if: CurrentQuestState("Quest 1") == "success") [[Quest 1 Finished]]

is what I would like in Twine. However, that syntax obviously does not work, haha. Is there a recommended approach to this?
User avatar
Tony Li
Posts: 21681
Joined: Thu Jul 18, 2013 1:27 pm

Re: Enable modding capabilities on database

Post by Tony Li »

If a link connects to a node whose text is exactly the same as the link in Twine, then in the Dialogue System they'll be treated as the same node instead of duplicating. You can put your conditions in that node.
BrightC
Posts: 7
Joined: Sat Jul 01, 2023 4:46 pm

Re: Enable modding capabilities on database

Post by BrightC »

Appreciate the help! But hmm, I must either be misunderstanding or something's not working the way it's supposed to. Merging the two nodes in Twine is somehow not working. I've got the setup on the left which is imported as shown on the righthand side. Got any idea what is going wrong there? From my understanding, the texts should be identical, so they should be imported as the same node. (In all three cases even, but I've highlighted the most basic one.)
identicallinks.png
identicallinks.png (76.6 KiB) Viewed 151 times
User avatar
Tony Li
Posts: 21681
Joined: Thu Jul 18, 2013 1:27 pm

Re: Enable modding capabilities on database

Post by Tony Li »

Hi,

Put "Player: " in front so the node gets assigned to the Player actor (i.e., a menu item):

quest1Open.png
quest1Open.png (15.08 KiB) Viewed 150 times

This way the link and the following node will (1) have the same actor (Player) and (2) have the same text. When those criteria are both true, the node will be merged with the link as a single dialogue entry.
Post Reply