I’m working on a dialog system for a game. I wanted to try to make it as flexible as possible and mostly event-based.
Things I’m concerned about:
-
Dialog:CreateReplyObject
is kind of weird. I am not using inheritance so this was the only way I could have Responses create Reply objects. Since Replies require the Response module I could not do vice versa without running into a cyclic issue. - Are any of the names confusing? Responses/Replies seem too similar to me and I often confuse the two.
- Is it confusing that Replies can also have responses?
- Are the destroy functions properly removing all instances so I can avoid memory leaks? I’m wondering if it’s better to have something like
self._instances
instead of havingself._prompt
andself._clickDetector
- Is creating responses/reply intuitive enough? I’m worried that if conversations were longer it might be really messy to look at.
- What kind of naming could improve the API?
Mainly looking for ways to improve the module or any feedback on the module design (not UI design.) Thanks.
Example of how the methods work can be found in StarterPlayerScripts > Dialog
dialog_test.rbxl (81.4 KB)
EDIT: Added a Dialog:GoToReply
method. It’s a little scuffed but it works.