Dialogue Tree Editor Plugin & Dialogue System [OLD]

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!

I’ll be sure to make a post about it here in the comments when it’s out. I’m really close to finishing all the features I need for the release but I’ve just been a little busy with other stuff lately.

3 Likes

It seems it’s a rather confounding Catch-22 at this point in time.

  • You can only use FireClient while on the Server as you stated, which a LocalScript can’t do. Plus, it can only work in certain places. It seems to outright vanish when placed and simulated in ServerScriptService.
  • However, a Server-side Script can’t bring up LocalPlayer so it can be cast to the player that activates it, which only a LocalScript can do.

Perhaps there is a way to do this, but I’ll have to put this aside for now.
I hope to get this working and customise it! Good luck with the updated release!

been waiting on this updated for a minute now hopes it comes out soon

The time has come! The new version of this system is out. You can find it over here with all of its instructions and whatnot:

Unfortunately, I wasn’t able to make the new editor and everything compatible with the old version which is why I’m leaving this system as it is.

6 Likes

:heart_eyes: yessserr lets go bruh I love you for this. pause