Page 2 of 2
Re: Enable modding capabilities on database
Posted: Sat Jul 15, 2023 9:58 am
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}";
}
Re: Enable modding capabilities on database
Posted: Wed Jul 19, 2023 5:37 pm
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?
Re: Enable modding capabilities on database
Posted: Wed Jul 19, 2023 8:03 pm
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.
Re: Enable modding capabilities on database
Posted: Sun Jul 23, 2023 8:45 pm
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 (76.6 KiB) Viewed 161 times
Re: Enable modding capabilities on database
Posted: Sun Jul 23, 2023 9:29 pm
by Tony Li
Hi,
Put "Player: " in front so the node gets assigned to the Player actor (i.e., a menu item):
- quest1Open.png (15.08 KiB) Viewed 160 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.