Dialogue Tree Editor Plugin & Dialogue System [OLD]

A “run code block” dialog element would be nice. That I can stuff RemoteEvents in the tree manually is cool, but it would be best if I could tell at a glance what/if/any nodes in my trees call code.

It would also be useful for the Lock component to allow other sections of dialog to set the lock = true. Right now it is only good for unlocking?

3 Likes

Guess it’s time to start focusing on the revamp now. I’ll look into both of these features.

I still had some problems in triggering the event to make the dialogue works, any idea how can i do that ?

2 Likes

Here’s how I do it, in a server side script.

local d = c:FindFirstChild("Dialogue")
		
		if (d) then
			game.ReplicatedStorage.DialogueRemote:FireClient(player, d )
		end

c is the character with a dialog.

6 Likes

Update on the upcoming remake! I’ve been thinking a lot about how I should structure the next system in terms of the node organization and all of that and I think I’ve finally found a solid design that will work really well. That being said, it will differ so much from the current version that it might have to be released as a separate plugin. In fact, because of the nature of the new version the dialogue system might just be one pre made system to work with this plugin. What I’m currently making is a framework for a whole node editor. Here are the nodes I made for the dialogue system:

https://gyazo.com/584011cdfcc784858ca5d3b9aa74785b

I really wanted the UI to look and feel something that would be native to Roblox studio to the best of my abilities so I decided to go with this design.

You might notice that it’s missing the redirect node and that there is a new node type in the mix as well. That’s right, redirect is no longer needed as you can connect nodes however you wish without a problem. And the command node is a much requested simple node that will run a written function.

I aim to add most of the requested features that caught my interest natively to the new system as well as some of my own wanted features.

It’ll still take some time before I have this system finished but nonetheless I would love to hear what you think of the current vision and what else you would like to see in the upcoming remake.

7 Likes

If there won’t be backward compatibility, might be a good idea to have a script to convert/upgrade old dialog. Looks great!

1 Like

Yes that might be possible and I will most likely give it a shot before I release this. Thank you!

I modified the dialogue system to have a tweened opening!

Replace line 24 - 37 with:

function EndDialogue()
	local tween = require(game.ReplicatedStorage.tween)
	local goals = {
		Size = UDim2.new(0.006, 0, 0.053, 0);
		Position = UDim2.new(0.261, 0, 0.934, 0)
	}
	tween.Tween(MainFrame, 0.2, "Bounce", "InOut", goals)
	wait(0.2)
	
	GUI.Enabled = false
	DialogueRunning = false

	SpeakerChangeConnection:Disconnect()
end

and line 240 - 258 with

if Arg1:FindFirstChild("InitialPrompt") then
			GUI.Enabled = true
			local tween = require(game.ReplicatedStorage.tween)
			local goals = {
				Size = UDim2.new(0.321, 0, 0.324, 0);
				Position = UDim2.new(0.5, 0, 0.813, 0)
			}
			tween.Tween(MainFrame, 0.2, "Bounce", "InOut", goals)
			
			DialogueRunning = true

			MainFrame.Title.Text = Arg1:GetAttribute("Speaker")

			SpeakerChangeConnection = Arg1:GetAttributeChangedSignal("Speaker"):Connect(function()
				MainFrame.Title.Text = Arg1:GetAttribute("Speaker")
			end)

			LoadNextExchange(Arg1.InitialPrompt)
		end

As you can see it requires a module titled “tween” here is the code for the module (I did not write this module script)

local functions = {}

functions.Tween = function(Instances, Time, Style, Direction, PropertyGoals)
	local function createTween(Inst, Time, Style, Direction, PropertyGoals)
		if Time and Style and Direction and PropertyGoals then
			local TInfo = TweenInfo.new(Time, Enum.EasingStyle[Style], Enum.EasingDirection[Direction])
			local Tween = game:GetService('TweenService'):Create(Inst, TInfo, PropertyGoals)
			Tween:Play()
			return Tween
		end
	end
	if type(Instances) == 'table' then
		local Tweens = {}
		for i,v in pairs(Instances) do
			local Tween = createTween(v, Time, Style, Direction, PropertyGoals)
			table.insert(Tweens, Tween)
		end
		return Tweens
	else
		local Tween = createTween(Instances, Time, Style, Direction, PropertyGoals)
		return Tween
	end
end

return functions

enjoy! :smiley:

edit: Not that this was a question but feel free to use this in the up coming v2.0

edit #2: these modifications assume that your current position & size of the dialogue gui are:

Size: {0.006, 0, 0.053, 0}
Position: {0.261, 0, 0.934, 0}
1 Like

Something that somewhat bugs me is that I have a sound play in the ‘repeat until’ that adds MaxVisibleGraphemes to the prompt, when I enable RichTextit will play a sound for every RichText character, built in support for italic/colored/bold/etc that doesn’t require RichText would be amazing.

1 Like

Yeah I think I’ll fix that for the next version since it kind of annoys me as well. I’ll keep you updated! :slight_smile:

1 Like

The only script that the plugin inserts is a LocalScript titled “DialogueHandler” which is a descendant of “DialogueGui”.
The install scripts button inserts:

  1. DialogueRemote (ReplicatedStorage)
  2. DialogueGui (StarterGui)

Is there an ETA on the remake?

I’d say maybe a few days from now.

1 Like

Love the plug-based visual UI, but I’m still struggling to call and run the remote in order to kickstart the process. Here’s what I’m using:

-- Local Script
local player = game:GetService("Players").LocalPlayer

print(player)

local d = workspace:FindFirstChild("TestDia")

if (d) then
	game.ReplicatedStorage.DialogueRemote:FireClient(player, d )
	print("Start!")
end

Both the script and the folder are in the Workspace.

Hey, having an amazing time with this system it’s been super useful. One thing I’ve been trying to implement in my game is having the gui close if the player doesn’t select a response in x amonut of time. It’d be great to get some help for a solution with this, in my attempts I can’t get the timer to reset again after the dialogue progresses

Does it print “Start!”?

If not, it could be an issue with the code loading in faster than the folder. Try doing WaitForChild instead of FindFirstChild.

If that’s not the case, do some printing within the DialogueHandler to see if the event reaches the system.

That’s an interesting feature, I’ll definitely add that. That beign said: I’ll add it to the new system first which I’m planning to release later today. But if you wish to keep using the older system I can make a quick edit to the code and send it your way to allow for that feature.

1 Like

Here’s my setup:


I’m slightly rusty at this, so I might have just made an amateur mistake.

One suggestion I may make is to also add an example of a dialogue trigger script when using the Install Scripts button, location and all.

Ah, there’s the issue. FireClient only works on a regular script and it can not be done from any of the replicated services. I’d recommend ServerScriptService for the script if you just wanna test.

Hi! Not sure if you got around to releasing, idk where to go to find it. If the new release is not out yet, and if its not too much trouble, it’d be a lot of help to do it with the older system. Thanks so much!