Tool that shortens your common work of creating dialog frames and scripts, modify the speed, design and delay in one single call.
Currently the module has a lot of checks to make the experience of use more dev-friendly.
Main Properties:
Property | Usage | Class |
---|---|---|
Body | Dialogue table: via strings | table |
chatChoice | Response strings to the final message of Body | table |
typeSpeed | Letter movement speed | number |
BetweenChat | Delay between dialog blocks | number |
canSkip | Player power to skip dialogues with a click | boolean |
AllowMovement | Player power to move in dialogue | boolean |
Constructor Properties:
Property | Usage | Class |
---|---|---|
Completed | Launched at the end of the dialogue // returns: response | RBXScriptSignal |
IsActive | Tells if the sistem is not paused | boolean |
Functions:
[ • ] ProDialogue.new(plr: Player, configuration: DialogueConfig)
Constructor that allows access to the module functions, in addition to modifying its properties, DialogueConfig is a type on its own.
ProDialogue.new(player, {
Body = {
"Message1",
"Message2"
},
typeSpeed = 0.08,
BetweenChat = 0.9,
canSkip = false,
AllowMovement = false,
})
This way the dialogue will end at the last message.
If for example the last chat is a question and you want to answer it. You can add the variable ‘chatChoice’ and add the answers to it
chatChoice = {"Response1", "Response2"} -- maximum: 3
returns system
.
[ • ] system:Begin(actor: string, imageIcon: string)
actor: The system title, will be renamed as the speaker name
imageIcon (optional): Image representing the speaker (its a string so player headshots can be added)
Basic chat
local ProDialogue = require(script.Parent)
script.Parent.Triggered:Connect(function(player)
local system = ProDialogue.new(player, {
Body = {
"hi",
"nice to meet you"
}
})
system:Begin("NPC")
system._Completed.Event:Wait() -- system doesn't yield so this is important
end)
.Response chat
local ProDialogue = require(script.Parent)
script.Parent.Triggered:Connect(function(player)
local system = ProDialogue.new(player, {
Body = {
"hi",
"how are you?"
},
chatChoice = {"fine", "not so good"}
})
system:Begin("NPC")
system._Completed.Event:Connect(function(val)
if val == "fine" then
print("player chose the first option")
end
end)
end)
.
[ • ] system:Pause(timer: number)
timer (optional): Time to reverse the chat state
Sets ‘system._IsActive’ to false. Pauses the current chat
[ • ] system:Resume()
Sets ‘system._IsActive’ to true. Resumes the current chat
Testing Video:
.Thanks for reading, remember that I will listen to all the suggestions given by the community
The module is fully accessible here: