Hi, I don't use Roblox but Love2d but this is by far the best video I found about OOP. I was looking into inheritance but this video just makes it crystal clear that this is far superior. Thank you so much for taking the time to make this.
@BRicey3 жыл бұрын
That is absolutely amazing! Your very welcome! I'm glad I can get to people who are not only using roblox, but other engines
@tomsterbg81308 ай бұрын
Yep, the fact that the mentality was explained really set me on my place. It's absolutely amazing to think of inheritance of "this is this" and composition of "this has this". Just the way of thinking is completely clear and you can see that it's superior. A human is an animal? Why don't we act dumb then. A human has animal features. This makes much more sense.
@Jason-xl8fm3 жыл бұрын
Thanks for this video, been learning how to use OOP programming recently and it can get quite messy with the functions. Really nice to see someone who provides tutorials using OOP since it's really a great way to clean up your code.
@jasonmckay27693 жыл бұрын
Simply explained. Great example as opposed to abstract concepts. Well done!
@vashthestampede99993 жыл бұрын
I asked for a video on composition last year and you finally did it, just wanna say great video and I really appreciate it.
@planeman44533 жыл бұрын
dude, this is exactly what i was looking for! Inheritance is quite limiting and composition looks so much better. Stumbled upon this from devforum, great video!
@tomsterbg81308 ай бұрын
I love this I love this I love this!!! I've just seen how Packages work and I know how Godot works so my mentality would be more like "let's use packages to construct classes instead". I want to be more visual about it instead of core-based because code requires you to read it. I want to see my structure. Anyway both your method and mine should be able to achieve the same goals - composition where by changing the components you change code everywhere. I find it much easier to understand less abstract concepts and ideas like having composition out of actual components and using them as if they are default Roblox instance classes.
@edrictigerist2 ай бұрын
Composition Sounds super cool! Glad i stumbled onto this video : D
@rakha88123 жыл бұрын
This is why the Knit's Component Module is so awesome
@wav851811 ай бұрын
B Ricey i love your content, after watching and learning your OOP series, what should we learn or do next? I feel stuck and honestly i dont know what to do.
@eliteengineer7340 Жыл бұрын
you always have what im looking for , you are amazing
@danil-old-web3 жыл бұрын
This is the knowledge we hunger for!
@bryceblazegamingyt97412 жыл бұрын
I would love to see an updated oop video on metatables and modulescripts! And I want to see your new practices because I'm starting to get interested in Roblox development again because I never knew that Roblox was powerful enough to make abstract classes. Love your work
@He_ze Жыл бұрын
old videos, but timeless content lol. Currently in the process of cleaning up the code of my old game and this video was very useful
@BRicey Жыл бұрын
Glad I could help!
@Roxaro2 жыл бұрын
other OOP tutorials was boring but this something else
@karlmarx27043 жыл бұрын
Creating Classes with other Classes you say? Hmmmmmmmm...
@BRicey3 жыл бұрын
I just noticed your name lol
@stemaidev2 жыл бұрын
because of you I learned how to use Metatables in module scripts. Thanks B Ricey!!
@BRicey2 жыл бұрын
Glad I could help!
@vineetsawant9074 Жыл бұрын
great example of how to implement OOP in Roblox!
@pfever7 ай бұрын
Downside of composition, you need to make tons of simple classes
@Relphy3 жыл бұрын
HAPPY 2K SUBSCRIBERS!
@Mr1Lito4 ай бұрын
13:01 i keep getting this error: attempt to index nil with 'IsFlat', why?
@Mr1Lito4 ай бұрын
it works now but i have no idea why, i asked chatgpt for help and it gave me a code to copy and paste (it was the exact same as mine) but now it worked
@Passsoio2 ай бұрын
I have the same problem, for some reason the values of the tables are printing nil
@jotanews17763 жыл бұрын
i fucking love you homie
@PixelKingStudios3 жыл бұрын
Nice video! Very informative 😄
@fusion.studioX2 ай бұрын
so composition is just a bunch of little inheritances
@nlaps3 жыл бұрын
Great vid! I'm trying to get my habbit into OOP.
@wifinoob30833 жыл бұрын
Love your videos.
@chillblox83 жыл бұрын
holy crap thanku i lov this method
@menoitius5587 Жыл бұрын
AWESOME tutorial
@GaLzZy. Жыл бұрын
it is kinda sad that there a no intellisense with OOP approaches in roblox studio :(
@vinicius._mbАй бұрын
If I wanted to access the base class (Vehicle) from one of its components (Engine, Wheel, etc.), how would I do it? The only way I can think of is by adding a property to one of these components that points to the base class, but that seems wrong for some reason. Is there a better approach?
@goose133786 ай бұрын
Tack!
@BRicey6 ай бұрын
Yeah!
@axelmonogatari31752 жыл бұрын
Its cool ... but DONT, by any means use ALWAYS composition. There are cases where it doesn't make sense and make you create lots of unnecessary modules. First check if TypeB is a TypeA (B can do all the things that A can, and can be replaced.), if not, then just extract in modules the things that you need from TypeA into TypeB. Also, you can use Both, and that's what I usually do a lot. For example: Vehicle (atributes: Name, color, speed, size) [methods: Move()] Car is a Vehicle(atributes: Engine, Wheels) Engine (Atributes: Capacity) [Methods: TurnOn(), TurnOff()] Wheel (Atributes: Color, size) Wings (Atributes: Color, size) Plane is a Vehicle(atributes: Engine, Wings) Bycicle is a Vehicle (Atributes: Wheels) In this example Vehicle is just an interface or an abstract class but the idea is that it can be upgraded with more unique methods that all vehicles will share.
@yarik_superpro Жыл бұрын
this still very confusing to me,why it overrides itself if i make 2 of them!?Isnt this whole point of OOP!?
@Thzyr3 жыл бұрын
Can you make another perlin noise vid cuz its outdated
@BRicey3 жыл бұрын
What do u mean? I don’t think the api has changed.
@Thzyr3 жыл бұрын
@@BRicey maybe try doing the script again i think i got something wrong
@ftgodlygoose47183 жыл бұрын
Great video, it really helped me understand. Now all I have to do, is re-code my game from scratch using OOP lol
@BRicey3 жыл бұрын
just try to integrate your codebase in the future with OOP, I wouldn't rewrite your game rn
@exotic93453 жыл бұрын
Can you make an on screen coordinates system?
@speedyg22959 ай бұрын
I am using your method to. create apples. But i keep getting new is not a valid member of ModuleScript "ServerScriptService.AppleModScript" - Server - appleTrigScript:2. Which coming from the SSS script called appleTrigScript on line 2 which is only 3 lines: local Apple = script.Parent.AppleModScript local A = Apple.new(workspace.farmQuestModel.AppleModel) A:Drive() Now of course the apple is not going to drive and have tires. But i put in the CFrame to move it there. But i cannot get past the not a valid member of the apple mod script which is put together just like Car in your video. where there is a: function Apple.new(appleModel). Any ideas
@speedyg22959 ай бұрын
Found it. I was not using Require in statement above
@kidthatcries3 жыл бұрын
Awesome video. Just one question, is there a way to use self object on the base table? Something like this: setmetatable({ using self in this table }, metatable) on the new method
@BRicey3 жыл бұрын
Sadly, you can't. The workaround is using: local self = setmetatable({}, mt), and then in a line below saying: self.Model = self:MakeModel() or something
@kidthatcries3 жыл бұрын
@@BRicey thanks I'm gonna try that
@audrete60713 жыл бұрын
How do you loop through a string? Like a for loop but instead of looping through a table it loops through a string
@BRicey3 жыл бұрын
for i = 1, string.len(yourString) do local char = string.char(i) -- do whatever you want with it. end
@audrete60713 жыл бұрын
@@BRicey thank you
@Ryan-ww7un3 жыл бұрын
I see someone watches Arjan Codes :)
@each1teach12 жыл бұрын
Thanks
@niklase.h.jensen22093 жыл бұрын
B ricey do you know how to make tank? If you do please tell me
@BRicey3 жыл бұрын
I made a crappy one in the past but I’ll do a tutorial on one in the future
@niklase.h.jensen22093 жыл бұрын
Thank you
@hello-uw2qw Жыл бұрын
Great video! This has helped me understand OOP in a way that no other tutorials could. A question I have, however, is how I would apply this in a practical approach. Let's say I want the car to move forwards when I press 'W', using a LinearVelocity. The thing I am stuck on is: - Detecting key presses is done on the client, so how would I call the server method of 'Drive()' on the client, when you can't pass metatables through a remote event, and sending a remote event from Client > Server isn't viable, as I would be using RunService to detect when W is held, and then increase the speed the longer it is held, and obviously sending a remote event 60 times a second is not good Obviously I am not asking you to write the code for me, but an explanation of how I could go about this would be greatly appreicated. Either way, thank you for the great video!
@BRicey Жыл бұрын
You could just use a proxy method, something on the server that receives the remote event and then runs the appropriate method on the class
@hello-uw2qw Жыл бұрын
@BRicey That's gonna cause loads of lag firing it 60 times a second, it needs to be done on the client. Atm I just don't use OOP for the client, and tbf it works fine but if I want to expand the code base its gonna be difficult
@BRicey Жыл бұрын
Yeah I wouldn’t fire it every second, only fire it for when it changes direction
@hello-uw2qw Жыл бұрын
@@BRicey i think changing it on the client is the best approach, due to the fact that tye client has network ownership so it would be lag free
@BRicey Жыл бұрын
@@hello-uw2qw yeah
@gabrielhallai99052 жыл бұрын
Hello hello
@eduardomattos15613 жыл бұрын
Chunk minecraft in roblox plss ;c
@my_beautifulnoob28893 жыл бұрын
E
@Revoltition Жыл бұрын
can you please explain it further for me? i get how it works but i don't really get why you would need to use it and in what cases should you do so