Advanced Dialogue System + Node Editor

You can edit the gui text label to have rich text on, and during the node tree editing for what the text is supposed to say you can put the rich text and it will work

Using this system in a shop system, and using the lock bit as a way to choose the confirmation dialog,
A here you go if you do have enough, and a leave if you dont, if it is correct i want to then grab the thing they bought and send it via a remote, but not sure how i can get it

the lock bit only prints the blue nodes, while i need the purple nodes, what kind of edit would i have to do?

Do i need a seperate lock and replies for every single purchase?

Cannot believe i went halfway into developing my own dialog system without finding this oH MY GOD

Whenever I press S in the menu to create a new node I only get 1 option which is “Node”. How do I fix this?

any updates on this new plugin?

2 Likes

this is a really cool plugins, but you can add presets like print (with custom text) …

Great plugin! I may be stupid here, but are conditions supposed to run as many times as the number of outcomes? When I write print checks in the Condition module, it prints twice.

Same issue here, there’s an answer posted by @Rocky28447 but i can’t seem to get it to work, can anyone lend a hand here?

Do you have some sort of example NPC @Sol_ttu? That would be really helpful for me to learn all the paramaters, etc.

Here’s a temporary fix, I’m not sure how reliable it is.

@TheThirdDescender @Rocky28447 @T0xicDarkn3ss

local Received

function CheckForCondition(Node)
	for _,InputNode in pairs(GetInputNodes(Node)) do
		print(InputNode)
		if InputNode:GetAttribute("Type") == "Condition" and InputNode:FindFirstChildWhichIsA("ModuleScript") then
			if #GetInputs(InputNode) <= 0 then
				local Function = require(InputNode:FindFirstChildWhichIsA("ModuleScript"))
				if Function.Run then
					if not Received then
						Received = Function.Run()
					end
					if Received ~= Node:GetAttribute("Priority") then
						return true
					end
				end
			end
		end
	end
end

Replace the CheckForCondition(Node) with this and remember to define your Received variable. (Located in StarterGui.DialogueUI.DialogueHandler)

This should fix the conditions running multiple times.

EDIT:
Also you need to add

Received = nil

after each

LoadNodes(GetOutputNodes(Node))

like this

image

EDIT 2:

Kinda forgot a bit, if you walk away from the NPC, it doesn’t reset your received value immediately. So for your

function LoadNode(Node)

replace it with this,

function LoadNode(Node)
	local Type = Node:GetAttribute("Type")
	
	if IsLocked(Node) or not UI.Enabled then
		return
	end
	
	if CheckForCondition(Node) then
		return
	end
	
	if Type == "Response" then
		
		local NewResponse = UI:FindFirstChild("SampleResponse",true):Clone()
		NewResponse.Parent = UI:FindFirstChild("ResponseFrame",true)
		NewResponse.Visible = true
		NewResponse.Text = Node.Text.Value
		NewResponse.Name = "Response"
		
		NewResponse.LayoutOrder = Node:GetAttribute("Priority")
		
		NewResponse.Size = UDim2.new(1,0,0,NewResponse.TextBounds.Y+5)
		
		NewResponse.Activated:Connect(function()
			CommonNodeFunctions(Node)
			LoadNodes(GetOutputNodes(Node))
			Received = nil
		end)
		
	elseif Type == "Prompt" then
		
		CommonNodeFunctions(Node)
		
		UI:FindFirstChild("Speaker",true).Text = CurrentParams.Speaker or "?"
		
		PromptFrame.Text = Node.Text.Value
		
		PromptFrame.MaxVisibleGraphemes = 0
		
		SkipTyping = false
		
		CanSkip = Node.Skippable.Value
		
		spawn(function()
			if PromptTypeWaitTime > 0 then
				PromptFrame.MaxVisibleGraphemes = 0
				for L = 1,#PromptFrame.Text do
					if (not UI.Enabled or SkipTyping) and CanSkip then
						break
					else
						PromptFrame.MaxVisibleGraphemes += 1
						task.wait(PromptTypeWaitTime)
					end
				end
			else
				PromptFrame.MaxVisibleGraphemes = -1
			end
			
			PromptFrame.MaxVisibleGraphemes = -1
			
			if (not SkipTyping or not CanSkip) and UI.Enabled ~= false then -- If the UI is closed, then don't wait to set the Received 
				task.wait(PromptWaitTime)
			end

			
			SkipTyping = false
			LoadNodes(GetOutputNodes(Node))
			Received = nil
		end)
	elseif Node:FindFirstChildWhichIsA("ModuleScript") then
		CommonNodeFunctions(Node)
		FireEvents(Node)
		LoadNodes(GetOutputNodes(Node))
		Received = nil
	end
end

This will prevent another NPC’s condition being unlocked if the NPCs are near each other and the player jumps from NPC1 (Condition success) to NPC2 (Condition false but reads as condition success)

1 Like

For some reason I get this error?

20:42:38.528 Players.FanoPlayzRBLX.PlayerGui.DialogueUI.DialogueHandler:20: attempt to index nil with ‘GetChildren’ - Client - DialogueHandler:20

This is the function that line 20 is on

	for _,Node in pairs(Tree:GetChildren()) do
		if Node:GetAttribute("Type") == "DialogueRoot" then
			return Node
		end
	end
end

I used this a while back and it was completely fine.

1 Like

Bump! Happening to me too, was realy looking forward to using this but it seems it’s not being updated anymore :frowning_face:

Judging the nature of the error, it appears that the Tree is non-existent and the resource is no longer maintained by the OP. I’ll go ahead and look into this and hopefully come up with a solution so that everyone can continue to utilize this resource.

It appears that the biggest issue that was plaguing the resource was within the Plugin’s source which in turn stopped a vast majority of the plugin’s initialization from finishing. So, when you accessed a tree, it would appear to be working but when you press S to open the drop down, it would not show your prompts.

Additionally, I decided it would be beneficial if I included the fixes and changes that I came across within this forum, credit going to @real_artxficial @Khrrxs. You both rock.

I am still testing everything out and running the patch through the gauntlet. I should have everything ready to go by Monday.

1 Like

When you gonna release this new plugin?

2 Likes

Hello! This seems a very neat and useful tool, and I’ve thought of some unique features for it:

Nodespaces - Groups of node presets, allows you to organize and use the node editor for many things.
You may set the tree’s nodespace on the gui.
SmallStrings - Allow for editing small strings in nodes that require them, since many of stringvalues in nodes are used for configuration.
EnumValues - Basically a value that works like an Enum, so for instance let’s say I create an EnumValue called “Axis”, and the axis can be either X,Y or Z. On the node editor the property will appear as a optionbox that allows me to choose the specific axis.
NodeInfo - a brief description of what the node and it’s property does, can be edited by the developer to assist comprehension of the system.

Anyways, another thing is to open source this project, because it could help a ton on projects that have many people that don’t know how to code and just want to design the dialogs.

Sincerely,
letiul.

probably. probably. probably. probably.

wdym bro, its open source already

I can’t handle that codebase, yet. :slight_smile:

How would i detect when the user is done with the dialogue, so i can fire a remote for debounce purposes.