When to Use a Resource Over a Dictionary?

  Рет қаралды 10,082

Coding Quests

Coding Quests

Күн бұрын

Пікірлер
@qooldeluxx
@qooldeluxx Жыл бұрын
I think the benefit to resource is that it can also contain methods, not just data
@CodingQuests
@CodingQuests Жыл бұрын
that is also true
@thesomeone2nd
@thesomeone2nd Жыл бұрын
Wdym with methods?
@qooldeluxx
@qooldeluxx Жыл бұрын
​@@thesomeone2ndit can contain functions in it as well. Like get sets. Atleast i think im still figuring out how it all works.
@CodingQuests
@CodingQuests Жыл бұрын
@@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
@gonderage
@gonderage 6 ай бұрын
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.
@CodingQuests
@CodingQuests Жыл бұрын
Read the Description for short answer, Also check out my upcoming course Godot Genesis on my site: www.codingquests.com/courses
@MoogieSRO
@MoogieSRO 4 ай бұрын
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.
@andrewgrinn3435
@andrewgrinn3435 Жыл бұрын
Thank you.
@7shiroi
@7shiroi 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 7 ай бұрын
I believe so yes. I think ive seen a few threads on this topic.
@635574
@635574 8 ай бұрын
Nice, I was looking for alternative to just dictionaries becuuse I canot declare types within and they also dont pass existing variable as reference.
@jaysistar2711
@jaysistar2711 5 ай бұрын
3:40 I think that you mean "It's inspectable by the editor, so instance contents are editable in the inspector."
@owenlloyd2528
@owenlloyd2528 Жыл бұрын
Thank you
@Asilhan
@Asilhan 6 ай бұрын
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 6 ай бұрын
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 6 ай бұрын
@@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 5 ай бұрын
Try plugin "edit resources as table"
@Asilhan
@Asilhan 5 ай бұрын
@@ennazen2793 Thanks man, this is what I wanted.
@tsiapal
@tsiapal Жыл бұрын
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 Жыл бұрын
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 4 ай бұрын
Script is like a blueprint for resource
@MoraesMusician
@MoraesMusician 6 ай бұрын
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...
@DinoTeaser
@DinoTeaser Жыл бұрын
jjviu
@charliecharliewhiskey9403
@charliecharliewhiskey9403 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.
@jiro4559
@jiro4559 3 ай бұрын
9:33
We Attempted The Impossible 😱
00:54
Topper Guild
Рет қаралды 56 МЛН
UFC 310 : Рахмонов VS Мачадо Гэрри
05:00
Setanta Sports UFC
Рет қаралды 1,2 МЛН
Vim Tips I Wish I Knew Earlier
23:00
Sebastian Daschner
Рет қаралды 83 М.
Modular Upgrades Made Easy Using the Strategy Pattern
6:41
Bitlytic
Рет қаралды 88 М.
Creating a Simple Inventory | Godot 4 Tutorial
10:06
Loafin Around
Рет қаралды 135
How to Use CLASSES in Godot 4 (everything to know)
12:51
DevWorm
Рет қаралды 30 М.
Dear Functional Bros
16:50
CodeAesthetic
Рет қаралды 564 М.
Python Tutorial for Beginners 4: Lists, Tuples, and Sets
29:05
Corey Schafer
Рет қаралды 1,5 МЛН
How To PLAN your Game as a Solo Developer
16:26
Heartbeast
Рет қаралды 527 М.
We Attempted The Impossible 😱
00:54
Topper Guild
Рет қаралды 56 МЛН