What is Object Oriented Progamming?

แชร์
ฝัง
  • เผยแพร่เมื่อ 19 ต.ค. 2024

ความคิดเห็น • 163

  • @DynastySheep
    @DynastySheep 7 หลายเดือนก่อน +9

    Showing 'workspace' with its methods and functions really gave me the spark of understanding OOP more.. thanks

  • @n3o.l1
    @n3o.l1 ปีที่แล้ว +89

    This completely described what metatable is for me cause I literally never used it before even though I’m an experienced scripter and it seems like it’ll help me later on ❤

    • @mysyvcic
      @mysyvcic ปีที่แล้ว +7

      metatables are so complicated to the point i dont even care about them

    • @EarthItself
      @EarthItself ปีที่แล้ว +5

      @@mysyvcic they are REALLY useful in the right situations tho

    • @neut_ro
      @neut_ro ปีที่แล้ว

      @Magic_Blox same bro

    • @MeinDasIstGut
      @MeinDasIstGut ปีที่แล้ว

      I don't know why but i never had much of a issue with metatables. All i saw metamethods as was just some specific events which you can set a callback to

    • @ahmed-music-prod
      @ahmed-music-prod ปีที่แล้ว +2

      ​@@mysyvcic exactly like its just easier not even using them lmao

  • @Recodetfort0
    @Recodetfort0 ปีที่แล้ว +25

    That's what it's all about! I just yesterday wanted to make a module with timers so I can easily start and stop them like Timer:Continue() and Timer:Pause() and at the same time have several of them with different speeds and time remaining, but I looked for tutorials about it but never figured it out... And today you made a video about it! Your videos are very helpful and so easy to understand! That I finally understood what this scary creature is - metatable! Thank you so much, GnomeCode, for being you!))))

  • @EmptyPringles
    @EmptyPringles ปีที่แล้ว +11

    Hey gnomeCode im watching you since maybe episode 5 of tower defense tutorial and you inspired to actually learn programming and now im learning c# and advanced blender stuff and i just want to say thank you because if not you i would stop at just making a free model obby and quit and probably forget about programming

  • @weylinstoeppelmann9858
    @weylinstoeppelmann9858 ปีที่แล้ว +8

    This video was suuuuper helpful! I've been wondering so long why some things use a . or a : and if it was something I can use myself or if it was only for built in roblox functions.
    This will help so much because I have a need for possibly dozens to hundreds of similar objects with varied stats

  • @2tukar
    @2tukar ปีที่แล้ว +4

    thank you so much gnomecode, ive been trying to learn about oop for so long, and this finally put logic in my head

  • @Brawlstriker89
    @Brawlstriker89 6 หลายเดือนก่อน

    I appreciate you breaking things down in the manner you do. You’re by far the best teacher when it comes to learning Lua’s programming language. I’ve learned other programming languages in college. So I appreciate your style.

  • @jsnotlout3312
    @jsnotlout3312 ปีที่แล้ว +3

    Super useful! I need to use module scripts more often, I always forget how useful they are.

  • @candykid44
    @candykid44 ปีที่แล้ว +6

    ok this was a video I actually needed

    • @mysyvcic
      @mysyvcic ปีที่แล้ว

      same here

  • @gabom103
    @gabom103 ปีที่แล้ว +2

    This video is really interesting and helpful, thanks GnomeCode.

  • @LuminosityZero
    @LuminosityZero ปีที่แล้ว +1

    I was literally saying “oop” right before you said it

  • @Totominator93
    @Totominator93 ปีที่แล้ว +1

    Yay an another vid, TYSM gnomecode for all things you make for us 👍

  • @bartoken
    @bartoken 10 หลายเดือนก่อน

    this is 100% the best channel for learning scripting. This helped me so much

  • @notdaycrucial5179
    @notdaycrucial5179 ปีที่แล้ว +2

    Love these videos. Thanks gnome code!

  • @HafuPlayStuff
    @HafuPlayStuff ปีที่แล้ว +1

    thank you, now i understand how metatables are working

  • @PUMCAM12
    @PUMCAM12 ปีที่แล้ว +2

    Great beginner tutorials you are creating!

  • @GigaGnome
    @GigaGnome ปีที่แล้ว +2

    I am 2 seconds in the the video and already love it! It helped me cure my illness!

  • @wonsole
    @wonsole 2 หลายเดือนก่อน +1

    1 year and bro has NOT noticed the typo

    • @appledoesrandomstuff
      @appledoesrandomstuff หลายเดือนก่อน

      ?

    • @isylvia
      @isylvia หลายเดือนก่อน

      @@appledoesrandomstuff title says "object oriented progamming"

  • @MarzFromMars
    @MarzFromMars ปีที่แล้ว

    Nice I’ve been wanting to learn metatables for a while!

  • @도경이-t2l
    @도경이-t2l ปีที่แล้ว

    I really think this kind of video is valuable. It would be great if you could also create videos about other concepts or skills that are useful while writing scripts or good to know

  • @embry4117
    @embry4117 ปีที่แล้ว +2

    Very helpful video! Thanks for making it.
    Could you continue your doors series? I really enjoy watching it, I learn a lot from it. (I don't write it down)

  • @inconnn
    @inconnn ปีที่แล้ว +13

    this is nice, but i would probably do something different for the .new() function.
    when you accept a table as an input for the new function, lua doesn't know what it's expecting. you should rather accept the individual attributes in the new function instead of a table. for example, this is more how i would do the new function
    function Food.new(name, color, description, price, quantity)
    local newFood = setmetatable({}, Food)
    newFood.Name = name
    newFood.Color = color
    newFood.Description = description
    newFood.Price = price
    newFood.Quantity = quantity
    return newFood
    end
    this will let the lua compiler verify that you are passing in valid arguments instead of garbage. You could before do something like "Food.new({garbage = "this is garbage"})" and it wouldn't complain. Sure, it works, but it wastes memory and there is no point.
    additionally, it will tell people what arguments the function is expecting when you call it. if it just has a table as an argument, that could be anything. but this will tell you exactly what you need to put in when you're typing it. and also you have to type more code when you're passing in a table.
    i do see a potential reason the other .new() function would be used, but it might be more appropriate to name it something like ".fromTable()" or something like that.
    i do like the video though, it does explain the basics of object oriented programming, but i think a bit more explanation on methods would help as well. i can see how they would get confusing.

    • @brawldude2656
      @brawldude2656 ปีที่แล้ว +1

      But isn't the whole point of metatables and metamethods is to accept whatever you want?

    • @LegoPieces_
      @LegoPieces_ 8 หลายเดือนก่อน

      Food.new({}) in the table looks working but it's just waste of memory.

    • @LegoPieces_
      @LegoPieces_ 8 หลายเดือนก่อน

      Althought server contains of memory and client doesn't uses that much performance.

  • @vileto_a
    @vileto_a ปีที่แล้ว

    This really did help me on what metatables are!

  • @74L
    @74L ปีที่แล้ว

    Exactly what I was thinking of learning next!

  • @pacspecific
    @pacspecific หลายเดือนก่อน

    I learned about OOP almost 5 years ago.

  • @aarongamerph
    @aarongamerph ปีที่แล้ว +2

    Maybe completing the collection by also doing a tutorial on Functional Programming?

  • @fnafmemeguy6984
    @fnafmemeguy6984 ปีที่แล้ว +1

    Gnome I know you probably won’t see this but remember in your tower defence game I know you probably can’t help but with the collision with the player aren’t working is there any idea why they aren’t?

  • @NeverEverFaceTheDark
    @NeverEverFaceTheDark 6 หลายเดือนก่อน

    This video is actually incredibly good

  • @PinxIsMe
    @PinxIsMe ปีที่แล้ว

    By far the best OOP video on roblox ever made. 💖

  • @WindyPivot
    @WindyPivot 5 หลายเดือนก่อน

    Okay. So here's what im getting or learn't. correct me if im wrong.
    MetaTables allow u to manipulate values without having to define a new table variable. It has a default that if u send another table of values will check the MainTable to see if anything is missing and assign it if needed. EG if ur default has the quantity value and u send over just the name itll assign the default quantity.
    The index thing connects the main table to check if something else is already in there? or is it what connects the defaulttable to the new one to see if there is any values needed.
    --Personal Test--
    I send over a food table with a new value of HPR(hpregen) and the table didnt break but instead treated it like it was already apart of it which I THINK IS VERY HELPFUL FOR MANY THINGS!!
    (If im wrong i don't mind being corrected im trying to learn, if im offmark or missing information please inform me :D)

  • @itsnamehere
    @itsnamehere ปีที่แล้ว

    w vid bro this finally solved my confusion (especially metatables lol)

  • @BasedOnBrian
    @BasedOnBrian ปีที่แล้ว

    Thx man! I know how to use self now since I get confused all the time

  • @MagmaRoblox1
    @MagmaRoblox1 ปีที่แล้ว

    Yay ur back with another vid. Can you make a series on how to make a Murder Mystery game, or and updated version of keys that u did in teddy caus putting the key in the tools didnt work for me. It make u break 90k but idk tho

  • @sonickirb
    @sonickirb ปีที่แล้ว

    no way i see a gnome code video 8 minutes after its uploaded 🥳

  • @ABlueThing
    @ABlueThing ปีที่แล้ว

    My brain just randomly clicked on how to make something in a FPS framework, I'm gonna have made 50 of those before i even publish a game

  • @CreatorreaTDS
    @CreatorreaTDS ปีที่แล้ว +1

    Santa tell me...
    Will you get in beeeed?

  • @Im_IntoDev
    @Im_IntoDev ปีที่แล้ว

    Nice beginner tutorials you are creating!

  • @Rocush
    @Rocush 10 หลายเดือนก่อน +2

    Hey man, It would be awesome if you made a tutorial but just dedicated to the .__index part. For me, that's the hardest part to grasp in this video.

  • @nzeust
    @nzeust ปีที่แล้ว

    gnome please stop avoiding the doors tutorial

  • @NathanielThomas-v5r
    @NathanielThomas-v5r ปีที่แล้ว +1

    Idea:💡 Can you please make a video on how to script plugins?

  • @Hanselkek
    @Hanselkek 4 หลายเดือนก่อน +1

    Can you do inheritance and composition?

  • @dise8785
    @dise8785 ปีที่แล้ว

    I know you already did a piggy series, but you should make one of those maze games like cheese escape

  • @NamLeNgoc-yf4mq
    @NamLeNgoc-yf4mq หลายเดือนก่อน

    I'm learning it in my school rn :D

  • @yes.5110
    @yes.5110 ปีที่แล้ว

    how to make a purchase prompt for catalog items and clothes appear when text button gui is clicked

  • @SUSSYBAKA-fq2ut
    @SUSSYBAKA-fq2ut ปีที่แล้ว

    We need a tower defense tutorial for skins lol but im pretty sure you are done with that series

  • @crypticsh0ot53
    @crypticsh0ot53 ปีที่แล้ว

    Hey gnomecode, I know you probably won’t see this, but in the slim chance you do, what is going to happen with the doors series, if you don’t mind me asking, I just wanna know if you will be continuing it.

  • @1x1x1LegoPiece
    @1x1x1LegoPiece 2 หลายเดือนก่อน

    i dont understand how does it know that you can call the eat function for myOtherFood

  • @eddiehazard3340
    @eddiehazard3340 4 หลายเดือนก่อน

    usually your videos are the best... but we couldn't follow this one too well.

  • @abdalrahamnabbasi
    @abdalrahamnabbasi 5 หลายเดือนก่อน

    is the metatable same as inheritance in c++ oop?

  • @mile.9768
    @mile.9768 ปีที่แล้ว

    Is there any way to overload constructors? For example;
    local fruit = Fruit.new(“Apple”, “a fruit!”)
    local fruit = Fruit.new(“a fruit!”)
    and the second option uses the name parameter (apple) from the index table instead of putting “a fruit” as the name parameter?

    • @AngelofSweden
      @AngelofSweden 8 หลายเดือนก่อน

      Not sure how that would work as Lua is not a typed language.

    • @wonny5306
      @wonny5306 หลายเดือนก่อน

      Use metatable over the new constructor ;)

  • @Sleep-f1w
    @Sleep-f1w ปีที่แล้ว

    I want to see a hungry pig tutorial video!

  • @epickid_4996
    @epickid_4996 ปีที่แล้ว

    When I watch this without even being able to code anything except for functions.😮

  • @BSSMacroless
    @BSSMacroless ปีที่แล้ว

    why use metables when you can still attach functions to tables

  • @AkamiChannel
    @AkamiChannel 8 หลายเดือนก่อน

    Sometimes I don't get the difference between the dot operator and the colon operator. Why is it Instance.new() and not Instance:new() ?

  • @salthal
    @salthal ปีที่แล้ว

    that was very helpful thank you

  • @apro8723
    @apro8723 ปีที่แล้ว

    when's the next gnomejam? I really want to know so I don't enter late like last time

  • @askshells
    @askshells 11 หลายเดือนก่อน

    what is the point of saying ..index for the "Food" table when you can instead just set the "FoodPrototype" as a metatable

  • @botnumb39
    @botnumb39 ปีที่แล้ว +1

    Great video

  • @Sasuke46525
    @Sasuke46525 10 หลายเดือนก่อน

    I didnt understand very well because we could do all of this stuff just using model function why did we use OOP

  • @Mivxor
    @Mivxor ปีที่แล้ว

    wow, this might be what i need to buss

  • @Cris-im6pl
    @Cris-im6pl ปีที่แล้ว

    Object oriented programming makes my head hurt in funny place

  • @yoskinny
    @yoskinny ปีที่แล้ว

    Could you please make a breakdown for creating party system thank you

  • @jokesflyovermyhead7491
    @jokesflyovermyhead7491 ปีที่แล้ว

    That's what I needed

  • @NeverEverFaceTheDark
    @NeverEverFaceTheDark 6 หลายเดือนก่อน

    But the bit about setting the metatable to itself is... I don't understand why the changes in the code reflect that. Wouldn't changing the index rule to 'food' be enough? Why get rid of the food prototype table? Do you HAVE to get rid of it? Ok so you don't. But the advantage is not having to look up another table. As in... You get all of the values via the food.new constructor if you want, filled values and default. While you can only get specific values or the prototype table the other way. Right. Oh AND you can't use self otherwise. Ok... How does the colon know there is an object(table?) that's got a metatable...? Wait do you need to first do the constructor then. Yeah. Ok. I see. But isn't this only useful if you add new layers of inheritance. Pasta, fruit, stews. And then I guess... You can pass in randomised values? No I still don't understand the point of it... Why have default values and functions? but it is very neat.

    • @wonny5306
      @wonny5306 หลายเดือนก่อน

      You Do!

  • @Erolsaurus
    @Erolsaurus ปีที่แล้ว

    Thanks!

  • @PAPABINGBONG1334
    @PAPABINGBONG1334 ปีที่แล้ว

    yo gnomecode can you make a tut how to make a badge giver when you click f9 and then on server and type a code that gives the player the bagde?

  • @nubbyx8096
    @nubbyx8096 ปีที่แล้ว

    Hi GnomeCode! I Was wondering if you could make a tutorial on making a basketball game in roblox. I would really appreciate it, because there are no tutorials on it, and I think you could easily make one. Thanks!

  • @FireFuzzball673
    @FireFuzzball673 10 หลายเดือนก่อน

    Thank you

  • @mile.9768
    @mile.9768 9 หลายเดือนก่อน

    What are the usages?

  • @GoIdappI555
    @GoIdappI555 ปีที่แล้ว

    When is the next how to make doors in roblox studio?

  • @anajotz
    @anajotz ปีที่แล้ว

    video 2 of asking for you to review retro studio again because it now has coding and a lot more games

  • @Childwhoisdum
    @Childwhoisdum ปีที่แล้ว

    thank you

  • @roganlowerson6221
    @roganlowerson6221 ปีที่แล้ว

    Hello, I have a video request.
    I was wondering if you could make a video explaining how to make it so during a game, any player can change some text, they are expected to type a decal id, then a script detects the id typed by the player, and changes a decal or image on a part or gui.

    • @Bradenyolo
      @Bradenyolo ปีที่แล้ว

      It's simple but does require a video to make. Here's a sample script (Please indent the lines as I was writing this code on mobile):
      local InputBox = script.Parent:WaitForChild("InputBox")
      local ChangeDecalId = script.Parent:WaitForChild("ChangeDecalId")
      local ChangeDecalImageEvent = game.ReplicatedStorage:WaitForChild("ChangeDecalImage")
      ChangeDecalId.Activated:Connect(function()
      local id = tonumber(InputBox.Text)
      if id == nil then
      return
      else
      ChangeDecalImage:FireServer("rbxassetid://"..tostring(id))
      end
      end)

  • @JustBey
    @JustBey 2 หลายเดือนก่อน +1

    So metatables are only useful for storing functions and heavily orginize your code.

  • @iplaytday9081
    @iplaytday9081 ปีที่แล้ว

    love ur vids 😂

  • @cookie3909
    @cookie3909 ปีที่แล้ว

    So useful!

  • @matx4044
    @matx4044 ปีที่แล้ว

    Can you record how to make Cheese escape system and Tower defense game (your tutorials is outdated) (Day 1 Waiting)

  • @ValidityValue
    @ValidityValue ปีที่แล้ว

    Hey, when doors tutorials?

    • @GnomeCode
      @GnomeCode  15 วันที่ผ่านมา

      1 year later - It's finally here!

    • @ValidityValue
      @ValidityValue 15 วันที่ผ่านมา

      @@GnomeCode thanks

  • @BrandonMilazzo
    @BrandonMilazzo ปีที่แล้ว

    Cover more tutorial topics

  • @Flrere
    @Flrere 8 หลายเดือนก่อน

    The explanation of __index is really what helped me understand the actual flow of what’s happening where I couldn’t before, thanks a ton❤. Basically, the module is just a bunch of default values for a table

  • @nomanhai
    @nomanhai ปีที่แล้ว

    Gnome code can u please start a teddi series nobody wil so can u

  • @yeetmanmega
    @yeetmanmega ปีที่แล้ว

    upload more, like do a tds game part 2 tutorials

  • @C_yber
    @C_yber ปีที่แล้ว

    Gnome code great

  • @RobloxHideandSeek199
    @RobloxHideandSeek199 ปีที่แล้ว

    Can you pleas make Skins for the Tower Defense. i need they so much so pleas

  • @Disksjw
    @Disksjw ปีที่แล้ว

    im kinda disappointed he ditched the doors series :(

  • @DaToastFilms
    @DaToastFilms ปีที่แล้ว +3

    hey Gnome code I hope you see this message but, I have problems with the piggy game, I tried learning from the uncopylocked game but nothing could beat the way you explain, I've been struggling for I while now.
    if your not gnome code please like so gnome code can see this.
    your truly -ToastFilms

  • @legendarykatar
    @legendarykatar ปีที่แล้ว

    bro holy fucking shit i didnt even know it was possible to drag such a simple concept on this longf

  • @wojp0777
    @wojp0777 ปีที่แล้ว

    Did I just watch a... Roblox programming tutorial? What langauge is it based on btw? Looks like Python but I'm curious

    • @GnomeCode
      @GnomeCode  ปีที่แล้ว +2

      Roblox uses a modified version of the Lua programming language

    • @wojp0777
      @wojp0777 ปีที่แล้ว

      Alright, thanks! I'm not into Roblox so I probably won't watch many of videos but good luck with your youtube career!

  • @funnydogreal
    @funnydogreal ปีที่แล้ว +2

    moral of the lesson: just use python

    • @Hadev123
      @Hadev123 ปีที่แล้ว

      It’s Lua in 100 seconds I think it’s actually a pretty good language

    • @vishkarcorp
      @vishkarcorp ปีที่แล้ว

      @@Hadev123 -compared to other languages commonly used by game frameworks and engines lua is a shitshow and luau is an even bigger shitshow. the only good thing is that its quite performant. but syntax and pattern wise, the fact that you have to use metatables for something simple as OOP is convoluted and doesnt even work properly with luau's type checking system. hopefully luau will add syntactic sugar for class declaration someday

  • @EATBADGE
    @EATBADGE ปีที่แล้ว

    yo its been a while

  • @piedoge5976
    @piedoge5976 ปีที่แล้ว

    and i oop

  • @truestbluu
    @truestbluu ปีที่แล้ว

    I'm still confused.

    • @lembarkii8669
      @lembarkii8669 4 หลายเดือนก่อน

      are you still confused?

    • @truestbluu
      @truestbluu 4 หลายเดือนก่อน

      @@lembarkii8669 I've got the hang of it now :)

  • @matrixgeg
    @matrixgeg 5 หลายเดือนก่อน +2

    best tutorial i ever found❤❤

    • @로좋
      @로좋 4 หลายเดือนก่อน

      For real

  • @DiamondBor
    @DiamondBor ปีที่แล้ว

    Cool video

  • @ScripterDan
    @ScripterDan 9 หลายเดือนก่อน

    and i oop-

  • @vishkarcorp
    @vishkarcorp ปีที่แล้ว

    only in roblox would the average programmer need to learn what OOP is lol

  • @lucasmikael9199
    @lucasmikael9199 ปีที่แล้ว

    do doors tutorial part 9

  • @TheHuggy
    @TheHuggy ปีที่แล้ว +2

    Cool, but we need more tutorial series

  • @abyssguardian
    @abyssguardian ปีที่แล้ว

    i am speed

  • @mrSEEK_official
    @mrSEEK_official ปีที่แล้ว

    my bad if your tired of doors comments but why is it taking so long? (I'm not RUSHing you)