I haven’t touched this in a bit so I might have forgotten but I think you have to open the database module and update the PlaceId in the Levels thingy to fit your game’s (so each place in your game corresponds a level, make sure to use the PlaceId and not the GameId). You need to do this too if you add more collectibles and such.
Thank you… THANK YOU SO MUCH
Greetings, after a long break from working on this i’ve decided to pick it back up for a little bit to add some much needed features, this time around the plan was to add a dialogue system as well as a port to the new physics character controllers, the avatar joint update, and ensuring the project worked with the new type solver (well, that was the plan anyways).
Reality is, i’ve been stuck rewritting defaultio’s typewritter for the last 2 months (with a lot of breaks in between, i’m not entirely insane yet), so to avoid having you wait until the next release, i’ll be releasing the module separately, I hope someone out there finds it of use.
SleekText
SleekText.rbxl (108.3 KB)
Preview:
Usage:
SleekText can be used much like the defaultio’s original richtext markup module with some minor differences in the syntax for consistency, and with the addition of some new marker types such as images and sounds.
Require the module, construct a “marker” (which is the object we’ll use to handle the playback of our text) passing the frame your text will be rendered inside of, the text itself, and an optional table with the initial properties you want your marker to have.
Example:
--Create marker
local Marker = SleekText.new(Frame, "<Sound = 421058925><font color=#FF7800><Sound = 154147007>H</Sound>i there!</font> This is a dialogue <Sound = 9117355465>🐷</Sound>! And this is an image<Sound = 7911099810> </Sound><Image=14280990902/>!")
--Completed
Marker.StateChanged:Connect(function(State)
if State == "Completed" then
print("Marker done playing")
end
end)
--Access the marker's lines
for LineNum, Line in Marker.Lines do
if LineNum == 1 then --Print the number of the line
print("This is the first line.")
end
for _, Char in Line.Chars do --Access the line's chars
if Char.Label:IsA("TextLabel") and Char.Label.ContentText == "H" then --Identify a specific letter
print("This is the letter H.")
end
end
end
--Play
task.delay(5, function()
Marker:Play()
end)
From here as you can see, you’ll gain control over playback, and you’ll be able to iterate over the lines and characters of your marker for full customizability.
Notes and Bugs:
Before you try to use this in production be aware, I don’t consider this module finished, nor do I think i’ll finish it anyways. Getting it to a functioning state took a ridiculous amount of time and i’m burned out from it, so while i’ll personally try to use it as it is, I wouldn’t recommend it for serious projects unless you are willing to fork it.
Some of the main issues I couldn’t quite iron out were:
- The wiggle style being broken.
- Style markups override the initial ones even after closed, which is unintended.
- Markups breaking when stacked in certain ways sometimes.
- Inconsistent spacing between characters due to the way lines/chars are calculated being wrong (i’m bad at calculating things sorry).
And there’s quite a handful of features I just couldn’t afford to support, such as:
- Offset support.
- Better self-closing markups support (example: < Sound SoundId = 123456, Text = “Text to play sound within”/ >. Which would allow typing sound markups quicker, while allowing us to attach a text to them, defaulting to a whitespace).
- Rewritting how lines/chars are calculated, which like i’ve already mentioned, is wrong.
- I might have forgotten to add support for the “non-font” built-in markups (eg: < b >< /b >), should be fairly easy to add them by changing a few lines though, maybe i’ll add it later.
And on top of that, I can’t guarantee full consistency with the original module as I didn’t understand a lot of it’s code, but I tried to be as faithful to it as I could (main thing I discarded were overflows as offset is not supported anyways, all text is scaled).
To not focus only on the bad, this impementation does improve on some aspects:
- While in the original module text was placed and animated dynamically on the spot, which caused my old laptop to lag pretty bad, in this implementation line/char placements are only done when the marker is constructed, so in theory performance should be better.
- As i’ve already mentioned, lines/chars and playback being exposed should allow you to have complete control over the system.
- It should be easier to add new custom markups and to support any built-in ones that are added in the future.
- Like everything in CE, this is strict typed (although this time around for the new solver, so the old one will be filled with warnings).
To close, If like me you consider the original module of big importance to the community, with lots of folks still using it to this day, and you find my reimplementation somewhat useful, i’d highly encourage you to improve it and share your findings with others, that way we can all benefit from it. Nonetheless for most cases, this will work fine (I hope, I haven’t tested it all that much).
Next Release
I don’t really do roadmaps anymore, but for the next release you should be able to expect the following things:
- Port to the new character physics controller & Avatar joint upgrade.
- Update the code to work with the new type solver.
- Yapper: An easy to use and highly customizable OOP dialogue system based on Dialogue Kit V2 (this is what SleekText was made for).
- To give you an idea of how it’ll work, you’ll start a “conversation”, and you’ll pass either a “dialogue”, “reply” or “replies” object to it in chain, each of which will provide signals for you to listen to each point of the conversation.
- This will work nicely with npc’s for quests and datastores to save progress on past conversations.
- Later down the road i’d like to provide a simple “history” system much like VNs usually have, but that’ll be for later if I do it at all.
- SwiftNotifier: A cleanup of a notifications module I made a while ago, it’ll let you display game events and errors to the player in a sweet way.
- Accolade: A simple attribution system made with TB+, it’ll save you some time when attributing community resources, and it should help automatically attribute UGC as long as attributes with the proper Id’s are in your NPC rigs (which some catalog plugins may or may not do for you already).
- KeyBinder will get some improvements (which are already done, I just haven’t updated the repo yet), main new feature is that now holding an action down will fire a separate input state unlike regular CAS, and binding an action to the A button and Space will use the jump button by default, these are toggleable in the settings as always.
- Just for fun i’ll probably have an example of an NPC following you in the next release, and I may or may not already have general pathfinding for NPC’s already working.
- I’ll try to write some documentation for the next release, ik the main reason no one uses CE is the lack of it but it, but I want to get it right.
- Additionally i’ll probably not bother with rojo anymore as I haven’t used it in a bit and built-in vsc support now exists, but we’ll see how it goes, next release might just be a raw place file like back when I released this.
- Lastly i’d like to rebrand the project to something more general purpose, as this isn’t really limited to platformers, things like KeyBinder and the Database pretty much fit all projects, and i’d like to keep adding general purpose resources to this.
Upcoming Changes/Deprecations (if I ever get to doing them)
Due to the nature of CE, if you like a feature, it’ll always remain available in past releases even if support for it is dropped (with more than enough documentation usually being available in their corresponding scripts, and with me being more than happy to help if anything breaks), with that in mind here’s a list of features that’ll probably be deprecated in upcoming releases.
- I’m evaluating splitting the database into separate chunks for each system or just straight up removing it and just using ProfileService separately on each thing, having it in one place is convenient for editing the data but idk if people can understand it rn (if you have a suggestion or preference, comments are open), this means you’ll need to transition your systems to account for this if you update to the latest release, although no data loss cases should happen.
- Realism will likely be dropped in favor of a built-in tilt/lean for the character within the moveset, a custom solution might be implemented at a later date for first person, but for now it’ll be dropped (this is mostly due to realism’s lack of maintenance as well as it having conflicts with some of the systems, feel free to keep using it).
- You know this cool ragdoll system I poured my soul into making for like a month? Roblox made it redundant with the avatar joint upgrade shortly after release
, so it’ll be removed in favor of that soon.
- Much like the previous, shortly after adding the “what’s playing” UI to the music system, Roblox rolled out a built-in one, but for now I won’t remove it as the built-in one only supports “verified artists”, and doesn’t offer the skip functionality.
- With the release of the new physics character controllers, heavy changes will likely need to be made to the swimming system in order for it to be as close to built-in as possible, although I don’t expect these changes to be anytime soon.
- Prior to the last release built-in docs for comments weren’t a thing, so I documented the classes with comments loosely based on moonwave at the top of the modules, that’ll have to be replaced in upcoming releases.
Ideally i’d say that if the current release you are using works for you, you should stick with it, at most only updating compartible systems that have only gotten bugfixes, but that’s down to personal preference.
Anyways that’s it for the update, sorry if it’s too much text, TDLR is I wasted 2 months on a half broken module, it wasn’t very worth it, next thing i’m releasing is a dialogue system for it, after that will probs be the next release, cya in a million years when that’s done.