Official Roblox Dialogue System and Dialogue Editor Beta


#41

Trade secret :wink:


#42

This is amazing. Thanks!


#43

Don’t look in the source code of the plugin, that would ruin the mystery.


#44

Taken. Looks great so far. Keep up the good work.


#45

It looks like many frames. The points between the frames seem to be calculated using a bezier curve of some sort.

That’s how I would do it anyways.


#46

Hey, everyone, I uncopylocked the dialogue demo place so you guys can peel it apart and see how I did what I did. Have fun!


#47

What about the plugin’s interface do you find bad? How can I iterate on its appearance so that it looks… sharper?


#48

Looks great! However there seems to be an issue where the Billboard GUI does not show back up again when you use the Player:LoadCharacter function. It produces this error:


#49

Ah, I hadn’t considered this case. Thanks for pointing it out!


#50

Have a look at these examples:

Unity Flow Canvas:

Unreal Engine Blueprint Script:

CD Project RED: Witcher 3 Quest and Dialogue Editor:

My problem with yours currently is the color contrast and the icons, grid rulers, etc. These are things that can make large tedious edits or even multiple different bubbles with different options so much easier to follow and more fun to use. People are going to spend a LOT of time in this editor, you want them to have something pleasing on their eyes that doesn’t make them feel like they are using a tool with UI slapped on it as an afterthought in design for how impactful it will make this editor be more appealing.


#51

I love the system, but perhaps another feature could be the addition of a more easily editable dialog GUI, with perhaps some default design options to choose from (such as: modern, rustic, quest etc) as well as a more easily accessable billboardgui (as a lot of new developers using the dialog system if this replaces the current one will not know what replicatedstorage is or what it does).


#53

Here’s some sample code to get you started if you wanted to bind a dialogue event to a ContextAction (good for xbox especially)

local RobloxDialogue_Root = game:GetService("ReplicatedStorage"):WaitForChild("RobloxDialogue")
local DialogueMode = RobloxDialogue_Root:WaitForChild("ClientInterface").Value

local ClientDialogueHandler = require(RobloxDialogue_Root:WaitForChild("Class"):WaitForChild("Client"))

local ClientDialogue = require(DialogueMode:WaitForChild("Interface"))
local DialogueRequested = RobloxDialogue_Root:WaitForChild("Remotes"):WaitForChild("DialogueRequested")

local function RunDialogue(RobloxDialogue)
	pcall(function()
	    ClientDialogue.Triggered(RobloxDialogue, function()
	        DialogueRequested:FireServer(RobloxDialogue)                                
	    end)
	end)
end

local LoadedDialogue = nil


local ContextActionService = game:GetService("ContextActionService")

ContextActionService:BindActionAtPriority(
	"RunLoadedDialogue",
	function(_, UserInputState, InputObject)
		if UserInputState == Enum.UserInputState.Begin then
			RunDialogue(LoadedDialogue)
		end
	end,
	false,
	Enum.ContextActionPriority.Default.Value + 10,
	Enum.KeyCode.E, Enum.KeyCode.ButtonX
)

repeat
	local ClosestTarget = nil
	local ClosestInDistance = math.huge
	for _, dialogue in pairs(ClientDialogueHandler.Dialogues) do
	    --loop
		local part = ClientDialogueHandler:GetClass("Utility"):GetDialoguePart(dialogue)
		local distance = part and ClientDialogueHandler.Player:DistanceFromCharacter(part.Position + dialogue.TriggerOffset.Value) or math.huge
		local inRange = distance < dialogue.ConversationDistance.Value
		if inRange then
			--Close enough, but is it the closest?
			if distance < ClosestInDistance then
				ClosestInDistance = distance
				ClosestTarget = dialogue
			end
		end
	end
	if LoadedDialogue ~= ClosestTarget then
		--TODO: If you need to fire a Changed event or whatever here; do it.
	end
	LoadedDialogue = ClosestTarget
	wait()
until false

#54

I’m not so keen on scripting, mind telling me what this is? Does it like connect two NPC dialogue events or something?


#55

The way I have it set up here is that you can press E (or X on a gamepad) to start a dialogue instead of having to click on the billboard gui


#56

The code firstly creates a function that runs whenever E (PC) or X (XBOX) is pressed. This function checks if LoadedDialogue exists (it exists when the player is close to the object they will be interacting with). If it does exist, it starts dialogue will the object.

The code below that (the while loop) is what checks to see if the player is in range of anything they can interact with, and if they are, sets the LoadedDialogue value to the closest interactable thing.

TL;DR the code makes the player able to interact with dialogue objects by pressing a key or button when they are close enough.

Edit: one minute between explanations what are the chances lol


#57

Ah thanks for the explanation! :pray: And the detailed explanation helped too @EmeraldSlash


#58

What GollyGreg posted is a valid way of using the system, but unintended. It would be better to add this kind of functionality into your Interface.


#59

Awesome.


#60

DUDE! This solves all my life problems! Joking :wink: It really looks cool tho. As a non-lua expert, I think this would make my future games a ton easier. Looking forward to playing with it.


#61

What is lua? :wink: