I need help replicating the undertale-like choice dialogue

Hello! So basically I am making an undertale-like game and tried replicating the dialogue and now trying to replicate the choice dialogue. So far I got everything down but just not the selection to choose an option to speak to the npc. I’d tried using varibles but so far it is a bit glitchy. How can I replicate it? Any help will be appreciated.

1 Like

What do you mean by replicate?

I mean like how to make the selection for choosing a dialogue to speak to the npc. Sorry, I don’t know why I worded it that way.

I recommend using a table, something like this

local DialougeModule = {
	["Character"] = {
		StartText = "Hey!",
		Responses = {
			
		},
	}
}

return DialougeModule

Ok that makes sense.

So you gotta have x number of options.

Lets say each option is a table of different paths to talk through.

You make your gui, and have all the different selection areas and just display the paths available.

Whenever the player clicks on a path(option) then you see the paths inside of that table. If there are none then the dialogue is over.

1 Like

This is a good idea! just one question: instead of making the player click on the option paths, how can I make it so the player can “move around” the selections.

Here’s what I meant:

O = the option the player’s at
→ = the key pressed to go to the next option
• = an unselected option

O Option1 → • Option2
• Option3 • Option4

• Option1 O Option2
• Option3 • Option4

Same thing just switch around the path
when I say path I mean a table kinda like Cool’s dialouge module.

I would have my table as such:

local ChatPaths = {
Path1 = {
Parent = ChatPaths,
Dialogue = "random stuff",
ChildDialogues = {
Path1 = {
Parent = Path1
Dialogue = "random stuff + new text"
ChildDialogues = nil 
}
Path2 = {
Parent = Path1
Dialogue = "random stuff + new text"
ChildDialogues = nil 
}
Path2 = {
Parent = ChatPaths,
Dialogue = "random stuff",
ChildDialogues = {
Path1 = {
Parent = Path1
Dialogue = "random stuff some random"
ChildDialogues = nil 
}

}

To go back and switch around, you just get all the paths in the parent, and use those as your options. Then you can use the paths stored inside of it ,chatting that happens because you talk about x topic as your other options, and finally to leave, you can use the parent path property.

An example would be talking about do you want to use my airplane because the first choice was to talk about planes.
You decide that no I dont want to fly your plane so you talk about a different topic originally offered, taking a boat.
Then you get the dialouge choice to use their boat.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.