When to Use a Resource Over a Dictionary?

Поділитися
Вставка
  • Опубліковано 14 січ 2025

КОМЕНТАРІ • 32

  • @qooldeluxx
    @qooldeluxx Рік тому +31

    I think the benefit to resource is that it can also contain methods, not just data

    • @CodingQuests
      @CodingQuests  Рік тому +5

      that is also true

    • @thesomeone2nd
      @thesomeone2nd Рік тому +1

      Wdym with methods?

    • @qooldeluxx
      @qooldeluxx Рік тому +7

      ​@@thesomeone2ndit can contain functions in it as well. Like get sets. Atleast i think im still figuring out how it all works.

    • @CodingQuests
      @CodingQuests  Рік тому +5

      @@qooldeluxx yes you are correct, it can hold any function. the main point to understand that a resource is just a template basically which holds a script inside it. so it can have functions, variables, w.e u want

    • @thesomeone2nd
      @thesomeone2nd Рік тому

      @@qooldeluxx oh ok thx I am still learning the engine

  • @MoogieSRO
    @MoogieSRO 5 місяців тому +16

    Maybe you've improved your videos since this one, but you should really script what you're wanting to say before hitting record. Listening to someone stumble over their words and repeatedly backtrack because they can't think of the best way to describe something is super frustrating to listen to and drags on the video length.

  • @gonderage
    @gonderage 6 місяців тому +9

    commenting b4 watching but
    when i want more certainty about the data i work with, and I use a specific format consistently a lot, and if I want intellisense, i use a resource. if it's a one-off container of data, then a dict is enough, and I don't have to write a whole class for it.

  • @jaysistar2711
    @jaysistar2711 6 місяців тому +3

    3:40 I think that you mean "It's inspectable by the editor, so instance contents are editable in the inspector."

  • @SleepyLazyPanda
    @SleepyLazyPanda 14 днів тому

    Very useful, thank you

  • @Asilhan
    @Asilhan 7 місяців тому +5

    Let's say we created a item resource then, using it we create 50 different items which have different values. How can I see their values in a excel-like environment? I mean listing them in a box. Do we need to export resources into a different program?

    • @CodingQuests
      @CodingQuests  7 місяців тому

      im not sure if theres a way to do that. maybe you could convert the .tres values into a json folder then go that way?

    • @Asilhan
      @Asilhan 7 місяців тому +1

      @@CodingQuests Hmmph. In a typical RPG game we have hundreds of items, enemies and quests. Represting them with resources must be hard if listing them isn't possible.

    • @ennazen2793
      @ennazen2793 6 місяців тому +4

      Try plugin "edit resources as table"

    • @Asilhan
      @Asilhan 6 місяців тому

      @@ennazen2793 Thanks man, this is what I wanted.

  • @andrewgrinn3435
    @andrewgrinn3435 Рік тому +1

    Thank you.

  • @7shiroi
    @7shiroi 8 місяців тому +7

    How about data-driven development? For example, if we have a JSON for items. I normally use a dictionary but the typing can be hard to manage. Is there a way for us to use resources?

    • @CodingQuests
      @CodingQuests  8 місяців тому +3

      I believe so yes. I think ive seen a few threads on this topic.

  • @owenlloyd2528
    @owenlloyd2528 Рік тому +1

    Thank you

  • @tsiapal
    @tsiapal Рік тому +1

    One thing that confused me. You created the item script before you created the item resource. Are these two related because of the same name or because of the extends Resource? And if it's the second doesnt that mean that all my resources will have the same variables even if I dont want to?
    And btw.... Happy New Years Eve!

    • @CodingQuests
      @CodingQuests  Рік тому +2

      you need a script attached to a resource, u can have 10 resources based on the same script. thats the general advantage of them, is that thy can use the same template baically

    • @Wisdawms
      @Wisdawms Рік тому

      You can't have a resource unless you have a script that extends Resource.

    • @maixior123
      @maixior123 5 місяців тому

      Script is like a blueprint for resource

  • @635574
    @635574 8 місяців тому +1

    Nice, I was looking for alternative to just dictionaries becuuse I canot declare types within and they also dont pass existing variable as reference.

  • @MoraesMusician
    @MoraesMusician 7 місяців тому +8

    you gotta structure/plan these a little bit better, man.
    the amount of times you went "no, let's do it a different way" made it so confusing...

  • @CodingQuests
    @CodingQuests  Рік тому +2

    Read the Description for short answer, Also check out my upcoming course Godot Genesis on my site: www.codingquests.com/courses

  • @charliecharliewhiskey9403
    @charliecharliewhiskey9403 3 місяці тому +2

    Slow down your typing a little bit. There's no point typing fast if you're going to spend all that gained time fixing mistaken keystrokes.

  • @DinoTeaser
    @DinoTeaser Рік тому +1

    jjviu

  • @jiro4559
    @jiro4559 3 місяці тому

    9:33