I’m assuming this would go in the scripting support category but please inform me if not.
What would be the best way to store dialogue for say, a conversation with an NPC or a tutorial GUI with multiple screens? The idea would be for a player to be able to go backwards and forwards through the different tutorial stages if necessary. Hope this makes sense haha
Well, you could use StringValues and make a folder, put it inside each of the NPC and put the values inside that folder, so whenever you wanna make the NPC say a certain text, you can refer to that folder and maybe use iteration.
Well, I personally think storing all the Dialogue in a Module would work great. And if you store it as a Table within that module, you can go back and forth through the table by increasing or decreasing the Index. Of course you’d also have to organize it with the different events and possible dialogues.
EVENTS/REMOTES:
Use an OnClient event and make a remote function doing this for you. The script contains all the dirty code (The code that in a way would flood a regular script) and just fire it every time.
MODULE SCRIPTS:
Use a module script to repeat this function every time.
Yes, and I do recommend the module method too, as it allows for any organization that you really want.
local Dialog = {
Tutorial = {
"This is the first piece of text shown to the player.",
"This is the second.",
"Continue adding entries here"
},
SomethingElse = {
-- ...
}
-- ...
}
return Dialog