What do I mean?
Well, since Resources are just data containers, this should not be too complex to achieve. What I mean is to, somehow, be able to create your own Resource type, making it possible to create data files and edit them within the editor.
How would it work?
My sincere apologies if it's not welcome to show how other engines do it, but I think it's interesting to exemplify. I will just not mention the framework/editor I'm talking about, but that's how one can create a Resource:
http://image.prntscr.com/image/fc4489a3b0104102974c6b08da2dd965.png
After compiling it, it's possible to edit the public properties (similar to export vars) of said Resource. Reminder: The Resource itself won't do any thing, it just stores data for the game to handle. The Resource's file extension could be fileName.resourceName.res.
Let's say I create a Resource type called Character and I name it George... Its filename would be george.character.res. There are other ways to name it, though (or maybe leaving it as field, so the user names it however they want).
When would it be useful?
That's a great way to make databases. One could make a --xml, json, ini or whatever-- the game would read and then would just create Resources for the game. Let's say I created a Weapon Resource, and a Character one. The Weapon Resource would contain: A string called Name, and a int called Damage.
The Character Resource would contain: A string called Name, and a ResourceRef
Then, I could create a Sprite node that would be my character, with a ResourceRef
I hope I'm clear and if there's already a feasible way to achieve this within Godot, let me know how.
You can make custom resource with an EditorPlugin. It's quite similar to making a custom node as described in the documentation, just replacing the base type to "Resource" (or one of it's subtypes).
It's still a bit cumbersome, since you can't use this custom types as export hints and it's a bit difficult to make a custom editor for your Resource type, since it's impossible to save it through the plugin (#6603). Still, it's possible to create, edit, and save them from the Inspector dock like any other Resource type.
@vnen to me it seems like he is talking about something like unity's ScriptableObjects, which are a nice thing to have anyways.
So... no chance for this to become a thing?
@indiemaatheus did you even read my previous comment? I literally said it _is_ already possible to create custom Resource types (just might not be in the ideal format _yet_, but there's always margin for improvement). If this is not what want, then describe it in another way.
BTW, I don't use Unity and have no idea what ScriptableObjects are.
Well, I did not mean to annoy you. What I asked is that - once you said it's "a bit cumbersome" process - if it was going to get some more attention from the team. And no, I'm not talking about an Unity's feature since I've never used it, but the idea is pretty simple and is probably the same as what KioriSun described.
you can already make a .gd that inherits from resource, then instance those
and save them to a file
On Tue, Nov 8, 2016 at 5:46 PM, indiemaatheus [email protected]
wrote:
So... no chance for this to become a thing?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/godotengine/godot/issues/7037#issuecomment-259254525,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AF-Z22eLL4F1vzpup92kCkbBgkc8vVCqks5q8N-hgaJpZM4KqEI5
.
It'll get improved, it's just not a priority for now. There's always community members working on stuff though, so maybe it gets looked sooner.
I created this Inheritance Dock plugin that I think will make this much easier.
The original issue should be fixed with @vnen's comment here: https://github.com/godotengine/godot/issues/7037#issuecomment-258568486 IIUC?
If you wondering how to make a .gd as a resource. This post in the dev forum answers it:
https://godotengine.org/qa/8139/need-help-with-exporting-a-custom-ressource-type
I'll close this as the base feature is now implemented. There are a few proposals related to improving custom resource usability, such as https://github.com/godotengine/godot-proposals/issues/18.
Most helpful comment
you can already make a .gd that inherits from resource, then instance those
and save them to a file
On Tue, Nov 8, 2016 at 5:46 PM, indiemaatheus [email protected]
wrote: