How to use Promises (and why you should) in Roblox Development

  Рет қаралды 31,127

B Ricey

B Ricey

Күн бұрын

Пікірлер: 74
@rotozap
@rotozap 2 жыл бұрын
As someone coming into the dev space with prior experience to traditional software/web development practices, I really appreciate you making these videos that show the 1:1 implementation of these practices into Roblox.
@niletheus
@niletheus 26 күн бұрын
are u Breadian?
@KebeMaro
@KebeMaro 2 жыл бұрын
Great video , it's nice to see a video that shows a specific library and why people should use it and how to use it, hope to see more like that.
@BRicey
@BRicey 2 жыл бұрын
Glad it was helpful! I could do a ton more for sure, but a lot of nice up and coming libraries are still in active development and not ready for production, but once they are fully released, stay tuned for a video!
@KebeMaro
@KebeMaro 2 жыл бұрын
@@BRicey Sounds great , I can't wait for that to happen , hope to see more of the great videos!
@ryanpmcguire
@ryanpmcguire Жыл бұрын
As a professional developer I’m quite impressed by this. I used to play Roblox when I was a kid and I haven’t in years. I’m glad to see Roblox is giving youngsters a solid outlet for writing useful programs. You will be a very very good developer later on
@onlytaylor8257
@onlytaylor8257 Жыл бұрын
hard to say if roblox is still for kids when the top devs are multi millionaires lmao.
@Baditow
@Baditow Жыл бұрын
@@onlytaylor8257 at this point most developers are corporate shills who don't care for making good games and instead milking the space dry
@ritsu9837
@ritsu9837 2 жыл бұрын
aint no way is this a coincidence i was actually am trying to find a good tutorial or even just an api guide for the promise module and then you posted, thank you so much!
@BRicey
@BRicey 2 жыл бұрын
I was reading ur mind
@lumbergrim6231
@lumbergrim6231 2 жыл бұрын
You are the best person for looking for these more advanced Roblox tutorials
@ShortyJustin
@ShortyJustin 2 жыл бұрын
I didn't know promises could be used for a round system this actually going to help my round-based games so, thanks!
@friedavi
@friedavi 2 жыл бұрын
This is awesome and really instructive... Keep on the great work!
@BRicey
@BRicey 2 жыл бұрын
Glad you liked it!
@lolleavingthischannel6826
@lolleavingthischannel6826 2 жыл бұрын
Just checked out a different tutorial and this literally melted my mind! thats how you know its good
@Simo-dm1zd
@Simo-dm1zd Жыл бұрын
10:10 so basically it's the same things as "try ..., catch... , finally..." on java
@BRicey
@BRicey Жыл бұрын
Sort of except honestly I like this pattern better. Exceptions in languages like java are cool, but result or option chaining in something like rust is better imo, and this is more similar to the latter.
@pokruk0
@pokruk0 2 жыл бұрын
In first one example you can just connect to destroying event and disconnect from touched signal there. Really strange example. Second one are more about error handling, not promises itself, it'sjust a good practice to do critical things even when error pop up
@betatester03
@betatester03 Жыл бұрын
What would you recommend as some more helpful examples?
@pixelthegreat1203
@pixelthegreat1203 2 жыл бұрын
Great Educational Video this will help me with my games!
@torpedofan8532
@torpedofan8532 2 жыл бұрын
You should try to explain the Signal library next
@Venopon
@Venopon 2 жыл бұрын
I have seen it before but didn't bother learning it. Thanks for the video, I'll use it. :)
@ritsu9837
@ritsu9837 2 жыл бұрын
oh and i got some recommendations for tutorial content: Maids(I think you already have covered this); Spring Module; Advance cframe (cant really find any that's good)
@BRicey
@BRicey 2 жыл бұрын
I haven't done maids yet, I still need to do that lol... Advanced cframes would be a good video, but I would like to focus it on some actual cframe problem, not general instruction. Like, instead of making a video about raycasts I'll make a video about guns. If you have any ideas for an equivalent challenge with cframes, make sure to let me know!
@lumbergrim6231
@lumbergrim6231 2 жыл бұрын
@@BRicey I think you should do a video on nevermore engine implentation
@ritsu9837
@ritsu9837 2 жыл бұрын
@@BRicey custom signals would be good as well
@zxibs3645
@zxibs3645 2 жыл бұрын
@@BRicey t by osyrisrblx, a really good runtime-typechecking module
@도경이-t2l
@도경이-t2l 2 жыл бұрын
Wow.. Good tutorial. It' really helpful. Thanks
@BRicey
@BRicey 2 жыл бұрын
Glad it was helpful!
@theleo7886
@theleo7886 2 жыл бұрын
Can you make an abbreviations numbers sistem?Please
@absolute_zero982
@absolute_zero982 2 жыл бұрын
that will be really helpful if you add Tutorial on Trove
@AT_arjun
@AT_arjun 2 жыл бұрын
My question: What Are Promises?
@Asp3ctD3v
@Asp3ctD3v 9 ай бұрын
sorry for the late comment but can you teach us about the lapis library
@timesl
@timesl 2 жыл бұрын
Hey, can you make a tutorial on how to make a data saver for something you buy in a game, for ex if u buy like a part in a game when you leave and rejoin it saves the part
@whoman0385
@whoman0385 Жыл бұрын
one problem.. nesting
@audreysbigheart
@audreysbigheart 2 жыл бұрын
can u make a vid about bodygyro again? it seems like roblox changed it
@Jj-yw4mw
@Jj-yw4mw 2 жыл бұрын
Nice video very informative. I still don't understand though, why is using this module better than taking 2s of my time putting in a conditional to stop any error from happening in the first place?
@BRicey
@BRicey 2 жыл бұрын
Because after a while it will take a lot of space and what happens if u forget ?
@pepperdayjackpac4521
@pepperdayjackpac4521 2 жыл бұрын
@@BRicey how will a conditional take a lot of space?
@polishedmeat6399
@polishedmeat6399 2 жыл бұрын
Is bridgenet worth using?
@NewEdens
@NewEdens Жыл бұрын
Can this be used in local scripts?
@lbsdark
@lbsdark Жыл бұрын
I'm using something on Mac, does anyone know a mac tutorial?
@holderman1206
@holderman1206 Жыл бұрын
I think the first two examples are just terrible. In the first example, if you see having reference to the primary part is a band-aid solution (which I see as the better one) why do you think the promise one isn't? It adds even more boilerplate code and things to care. You even said that you technically caused a memory leak because you forgot to take care of something and that it wouldn't be structured that way in a real game anyway. That just defeats the whole purpose the example if it's not gonna be like that in a real game. In the second example, if an error occurs, you should actually just solve the issue rather than putting them in a promise and ignoring it, which was just basically pcalling with extra steps in this particular example. You wouldn't know what kind of error your got or what went wrong. It can even cause more issue depending on the error you got which your code will have no idea of because you've just made it ignore the error.
@BRicey
@BRicey Жыл бұрын
The promise solution prevents code from running that doesn't need to run... and in a real game you'd just give all of your promises to a trove or maid or janitor for it to clean up on an object's deletion (I admit my explanation was poor but the concept is still there). As for the second example, by all means feel free to actually address the problem at hand, but in reality no developer will ever catch every bug before production -- it's better to write error resilient code than just assume your code's gonna work. And, no one's stopping you from catching the error and logging it to a database to try and replicate later and fix. Not gonna lie though, I was of your opinion for the longest time, but after sustained work on a big project, incorporating promises really helped my code.
@coolkid_2554
@coolkid_2554 2 жыл бұрын
help me do this please i want the player to open a gui if its health is less than 35 if Player.Character.Humanoid.Health
@ascendedreality8546
@ascendedreality8546 Жыл бұрын
... Put the script in side the gui. , change script.Parent.Parent.Visible = true to script.Parent.Visible = true, and make sure you define player
@stemaidev
@stemaidev 2 жыл бұрын
show setup and use cases for maids please
@BRicey
@BRicey 2 жыл бұрын
should be coming soon
@gemmken
@gemmken 2 жыл бұрын
have you guys ever promised a bot? yea, after this
@piraloco5864
@piraloco5864 Жыл бұрын
So, is this like a maybe monad? intresting!
@BRicey
@BRicey Жыл бұрын
Lol I never thought I would hear someone comparing concepts already learned in Haskell to roblox, but yes you are right. There's also a more general library called Option in Roblox meant to mimic Rust's option type which was based on Haskell's maybe. I love the functional programming though, keep at it!
@WindyPivot
@WindyPivot 2 жыл бұрын
What is the difference between task.wait and just wait 🧐
@BRicey
@BRicey 2 жыл бұрын
It’s better. Just use it. Normal wait has a couple of issues
@WindyPivot
@WindyPivot 2 жыл бұрын
@@BRicey I see, alr
@MarioMario-yb3iz
@MarioMario-yb3iz 2 жыл бұрын
@@WindyPivot yea what he said, task.wait is the newer version anyways
@OcnarfPro
@OcnarfPro 2 жыл бұрын
task.wait() is more accurate, the lowest it can go is 1/60 seconds while for wait() it is 1/30 seconds
@lossycompressed
@lossycompressed 2 жыл бұрын
could you cover another library called "RaycastHitboxV4"? this will be extremely helpful if you do, and thanks.
@wowland6873
@wowland6873 2 жыл бұрын
Raycast hitbox provides an API for you to read, perhaps try that instead.
@lossycompressed
@lossycompressed 2 жыл бұрын
@@wowland6873 lol, thanks i already figured it out with reading the module comments and peeking in a raycasthitbox weapon example
@8ava8198
@8ava8198 2 жыл бұрын
its called pcalling.
@BRicey
@BRicey 2 жыл бұрын
You can chain promises but not pcalls, and add custom behavior to them too.
@templed2021
@templed2021 2 жыл бұрын
i promise you that this is very useful
@moodyblues165
@moodyblues165 2 жыл бұрын
I've 2 suggestion! Add weapons Or add a money display instead of relying on the leaderboard telling you Include all if you want :)
@GalaxyedRainbow
@GalaxyedRainbow Жыл бұрын
Or Do local model = workspace.Model model.PrimaryPart.Touched:Connect(function() if model.PrimaryPart ~= nil then model.PrimaryPart.BrickColor = BrickColor.Red() end end)
@Martanus
@Martanus Жыл бұрын
easier is if not model.PrimaryPart then return end
@OskarP2601
@OskarP2601 Жыл бұрын
useless library imo. solving a problem that wasnt there in the first place tbh
@alek002
@alek002 Ай бұрын
...
@SULTANVIDEOGAMES
@SULTANVIDEOGAMES 10 ай бұрын
pcall
@AmazingRocker
@AmazingRocker 2 жыл бұрын
I wish this video existed when I was learning promises 🥲, Anyways great content as always man!
Правильный подход к детям
00:18
Beatrise
Рет қаралды 11 МЛН
IL'HAN - Qalqam | Official Music Video
03:17
Ilhan Ihsanov
Рет қаралды 700 М.
小丑教训坏蛋 #小丑 #天使 #shorts
00:49
好人小丑
Рет қаралды 54 МЛН
99.9% IMPOSSIBLE
00:24
STORROR
Рет қаралды 31 МЛН
What is Object Oriented Progamming?
13:27
GnomeCode
Рет қаралды 47 М.
METATABLES | What are they and how can we use them?
18:40
Crusherfire
Рет қаралды 29 М.
you SUCK at organizing scripts... Let's fix that!
13:12
Crusherfire
Рет қаралды 24 М.
Investigation: How Roblox Is Exploiting Young Game Developers
22:44
People Make Games
Рет қаралды 2,5 МЛН
Composition Over Inheritance - OOP in Roblox Studio
17:31
B Ricey
Рет қаралды 23 М.
How To EASILY Make Procedural Animations In Roblox
6:46
Roox4
Рет қаралды 122 М.
What Roblox Doesn't Tell You | Roblox Studio
9:38
Stewiepfing
Рет қаралды 33 М.
Roblox Module Scripts (The Right Way)
15:20
qweekertom
Рет қаралды 26 М.
Правильный подход к детям
00:18
Beatrise
Рет қаралды 11 МЛН