I want to show you the Bert Brothers (not canon characters in the yet-to-be-named-and-yet-to-be-officially-in-progress RPG). My dynamic dialog system has brought some life into them! The conversation between these brothers, powered by scripts, is quite interesting:
I use a ModuleScript returning a function that changes the dialog depending on different factors (for example, with the case of the Bert Brothers, if the player accepts Noobert’s request to make Bertnoo happy). Here is what Bertnoo’s dialog script looks like:
Bertnoo's script
return function()
local Bertnoo = script.Parent.Parent
local HappyState = Bertnoo:GetAttribute("HappyState")
if HappyState == "Happy" then return {}
elseif HappyState == "MakeHappy" then
return {
{ "Profile", "rbxassetid://10594574340" },
{ "Go away", "What's the matter?" },
{
"Choice", "Dumbert has been too dumb recently. Now he hates me.",
["I can see that."] = {
"Oh well. I won't trust anyone anymore so I don't like you."
},
["At least you have me!"] = {
{ "Really?", "Of course!" },
{ "Profile", "rbxassetid://10594669389" },
function()
script.Parent.Decal.Texture = "rbxasset://textures/face.png"
Bertnoo:SetAttribute("HappyState", "Happy")
end,
{ "Thanks man. I appreciate it.", "You're welcome!" }
}
}
}
end
return {
{ "Profile", "rbxassetid://10594574340" },
{ "Go away", "Why?" },
"I don't like you."
}
end
This is really turning out to be a proper RPG yet all I was doing was messing around with Rojo!